bb7b8d5e02
Add tests for multiple python_pkg modules
...
- download_cats: Test generate_cats functionality (100% coverage)
- keyboard_coop: Test keyboard_listener with mocked pynput (22% coverage)
- mock_server: Test mitmproxy request interceptor (100% coverage)
- random_jpg: Test JPEG generation with mocked Pillow (100% coverage)
- randomize_numbers: Test random_digits functions (99% coverage)
- scrape_website: Test scrape_comics with mocked requests (98% coverage)
- split: Test text splitting utilities (100% coverage)
- tag_divider: Test tag_divider with mock filesystem (44% coverage)
- extract_links: Add HTML fixture for tests
2025-12-01 19:49:44 +01:00
f7839ddff2
refactor: clean up pyproject.toml - remove defaults and redundant configs
2025-12-01 16:33:42 +01:00
134d606db0
fix: remove all pylint disable comments and enable all meta checks
2025-12-01 16:22:03 +01:00
3a477dd868
fix: enable all pylint checks by wrapping scripts in main()
...
- Remove too-few-public-methods and invalid-name from disabled checks
- Wrap module-level code in main() functions:
- generate_jpeg.py
- random_digits.py
- generate_cats.py
- scrape_comics.py
- Rename download_image -> _download_image (private function)
Pylint score: 10.00/10 with all checks enabled
2025-12-01 16:15:03 +01:00
077a31cb54
fix: address all pylint warnings
...
- R0914 (too many locals): Extract helper functions in generate_jpeg.py,
engine.py, lichess_api.py, main.py
- R0902 (too many instance attributes): Use dataclasses in keyboard_coop
- W0621 (redefined outer name): Rename parameters/variables to avoid shadowing
- W0201 (attribute outside init): Initialize all attrs in __init__
- R1705 (no-else-return): Remove unnecessary else after return
- C1805 (implicit booleaness): Use implicit boolean checks
- R1732 (consider-using-with): Use context manager for subprocess.Popen
- E0401 (import-error): Add pylint disable for optional deps (selenium, mitmproxy)
- Clean up pyproject.toml: update comments, remove redundant settings
Pylint score: 10.00/10
2025-12-01 16:11:15 +01:00
52476d1b15
fix(lint): fix G004 and PTH123 violations across codebase
...
- Convert f-string logging to % style (G004)
- Convert open() to Path.open() (PTH123)
- Remove G004 and PTH123 from global ignores in pyproject.toml
2025-11-30 23:57:49 +01:00
8493e5c7d7
fix(lint): restore S603 noqa for trusted subprocess call
2025-11-30 23:49:57 +01:00
77119ff197
fix(lint): fix S603 in engine.py and D100 in conftest.py
...
- Add noqa: S603 for trusted internal C engine subprocess call
- Add module docstring to conftest.py
- Remove per-file ignores for engine.py and conftest.py from pyproject.toml
2025-11-30 23:43:34 +01:00
2f13a8c228
refactor(lichess_bot): reduce complexity with dataclasses and extracted functions
...
- Add GameState, GameMeta, BotContext dataclasses for state bundling
- Extract 20+ helper functions from nested closures to module level
- Fix C901, PLR0912, PLR0915 complexity violations
- Fix mypy type errors with proper type annotations
- Add noqa for intentional S603 (subprocess call to trusted internal script)
2025-11-30 23:40:53 +01:00
a0761eccfc
refactor(stockfish_analysis): reduce complexity of main() function
...
Break down monolithic main() into smaller, focused functions:
- _build_argument_parser(): CLI argument setup
- _load_game(): PGN file loading and parsing
- _configure_threads/hash/multipv/nnue(): Engine configuration helpers
- _setup_engine(): Engine initialization orchestration
- _get_best_move(): Engine best move extraction
- _evaluate_position(): Position evaluation wrapper
- _classify_mate_move(): Mate score classification logic
- _analyze_single_move(): Single move analysis
- _log_move_analysis(): Move analysis logging
- _run_analysis(): Analysis loop orchestration
- _analyze_last_move/all_moves(): Specific analysis modes
Add dataclasses MoveAnalysis and AnalysisContext to bundle related
parameters, improving code organization and reducing function signatures.
This removes the need for C901, PLR0912, PLR0915 per-file ignores
as all functions now comply with complexity limits.
2025-11-30 23:23:10 +01:00
3f9ba376e0
fix(lint): convert os.path to pathlib - remove PTH per-file ignores
...
- Converted os.path patterns to pathlib.Path in 15+ files
- os.path.join → Path /
- os.path.dirname → Path.parent
- os.path.exists → Path.exists()
- os.path.isfile → Path.is_file()
- os.path.abspath → Path.resolve()
- os.mkdir → Path.mkdir()
- os.listdir → Path.iterdir()
- os.getcwd → Path.cwd()
- os.replace → Path.replace()
- Updated function type hints to accept str | Path
Added PTH123 (open() vs Path.open()) to global ignores as stylistic preference
2025-11-30 23:03:03 +01:00
2ffa1cc169
fix(lint): LOG015 - replace root logger with module loggers
...
- Add _logger = logging.getLogger(__name__) to all modules
- Replace logging.X() calls with _logger.X() calls
- Remove logging.basicConfig() from module level (keep in run_bot())
- Add G004 to global ignores (f-strings in logging are more readable)
- Remove LOG015 and G004 per-file ignores from pyproject.toml
- Fix pytest_ignore_collect hook signature in conftest.py
2025-11-30 21:59:24 +01:00
e2d0c103ae
fix(lint): BLE001 - replace blind except with specific exceptions
...
Replace bare 'except Exception' with specific exception types:
- ValueError for move parsing (chess.Move.from_uci, board.push_uci)
- json.JSONDecodeError for JSON parsing
- OSError for file operations
- ImportError for optional imports
- AttributeError for attribute access
- TypeError for type-related operations
- requests.RequestException for HTTP operations
- subprocess.SubprocessError for subprocess failures
- selenium.NoSuchElementException for element finding
Also fixes:
- pytest hook signature issue in conftest.py (_config -> _)
- Missing file handling in test_puzzles.py
- Line length in stockfish_analysis.py
Removes all BLE001 per-file ignores from pyproject.toml.
2025-11-30 21:37:47 +01:00
aeb5b679a0
fix: resolve PERF203 try-except in loop violations
...
- Extract try-except bodies into helper functions:
- download_cats: _download_single_image()
- randomize_numbers: _parse_single_number()
- lichess_bot/main: _apply_move_to_board(), _process_event_stream(), _run_event_loop_iteration()
- Use else block for return statements after try (TRY300)
- Remove PERF203 from per-file ignores in pyproject.toml
2025-11-30 21:29:03 +01:00
22333931cc
refactor: rename folders to fix N999, INP001, S311 linting rules
...
- Rename PYTHON/ to python_pkg/ (fix N999 uppercase folder)
- Rename camelCase folders to snake_case:
- randomJPG -> random_jpg
- tagDivider -> tag_divider
- downloadCats -> download_cats
- keyboardCoop -> keyboard_coop
- extractLinks -> extract_links
- scapeWebsite -> scrape_website
- Rename camelCase files:
- generateJpeg.py -> generate_jpeg.py
- tagDivider.py -> tag_divider.py
- Rename poker-modifier-app to poker_modifier_app (fix INP001)
- Add __init__.py to poker_modifier_app
- Replace random module with secrets.SystemRandom (fix S311)
- Fix S110 try-except-pass with contextlib.suppress
- Update all imports and config references
2025-11-30 21:20:17 +01:00
e2415dec05
fix: resolve shellcheck warnings
...
- lint_python.sh: remove unused VERBOSE variable, use OVERALL_STATUS for exit
- run_game.sh: add || exit after cd
- install_arch.sh/uninstall_arch.sh: separate local declaration and assignment
- lint.sh: use variable for pkg-config output to avoid word splitting
2025-11-30 13:48:17 +01:00
5966821bad
fix: correct shebang and executable permissions
...
- Add +x to Python scripts with shebangs (3 files)
- Remove -x from non-script files like .cpp, .txt, makefile (23 files)
- Move shebang to first line in C/imageViewer/lint.sh
2025-11-30 13:42:16 +01:00
74f2e24eab
fix: some linting issues
2025-11-01 20:11:45 +01:00
84cf151e02
feat: accept first argument as audio by defauilt sonic pi
2025-10-26 16:33:37 +01:00
6e988cbe09
chore: hello world sonic pi track
2025-10-26 15:19:37 +01:00
6cc5d71482
feat: champions leauge server
2025-10-03 16:03:53 +02:00
aa7ce601d3
wip: opening learner
2025-09-08 16:58:17 +02:00
e61221179d
feat: added lichess db puzzle to gitignore
2025-09-07 15:45:25 +02:00
61d6d347f5
feat: failed attempt at solving more than 4 puzzles
2025-09-07 14:53:50 +02:00
5740608052
feat: added micro max engine
2025-09-07 13:31:13 +02:00
4e86af448b
feat: engine passes 2 puzzles from lichess
2025-09-07 13:07:15 +02:00
90f7328c45
feat: C engine
2025-09-06 18:26:31 +02:00
7803be4371
feat: added script to extract links form html
2025-09-06 14:00:34 +02:00
80ef4e861e
feat: pof show battery in react app
2025-09-02 15:19:30 +02:00
1850b2fa27
feat: football api
2025-08-24 13:56:30 +02:00
4125436fec
fix: left button drift
2025-08-24 13:23:58 +02:00
f97a06f440
feat: remove the yellopw line
2025-08-24 13:19:50 +02:00
41fa4c5d04
feat: sound effects
2025-08-24 13:17:58 +02:00
74120f2cde
feat: make the game have any sense at al
2025-08-24 13:14:47 +02:00
372326f8ac
feat: simple fps game
2025-08-24 13:11:24 +02:00
6d02e82fe7
fix: most lint issues
2025-07-14 16:25:23 +02:00
ea8f45acfb
chore: made static functions static
2025-07-14 16:08:05 +02:00
245c156c8c
feat: wrap memcpy and sprintf executions into single function
2025-07-14 15:59:26 +02:00
2cd13fdfa7
wip: questionable linting fixes
2025-07-14 15:29:01 +02:00
7abe30c08a
chore: added linting to image veiwer
2025-07-14 15:14:19 +02:00
d1c869cc06
feat: image taks as much space as possible, resize it automatically
2025-07-14 15:00:16 +02:00
17bfc20ec5
feat: load all image files in a folder when opening single image
2025-07-14 14:53:16 +02:00
4bfd4133ce
feat: added installation script for image viewer
2025-07-14 14:38:04 +02:00
acd28fc6cb
feat: some new features in image viewer
2025-07-09 18:31:21 +02:00
3f41e5c821
feat: added simple image viewer
2025-07-09 18:05:59 +02:00
56187cc96c
Merge branch 'main' of https://github.com/kuhyx/testsAndMisc
2024-11-14 20:53:05 +01:00
b8e3f0c577
wip: websocket server in C
2024-11-14 20:52:38 +01:00
dc46a88993
feat: translated scrape website comics to C
2024-11-14 08:29:40 +01:00
fba7fe49b8
feat: translated split into "C"
2024-11-14 08:29:39 +01:00
3728eccd12
chore: updated Licenses
2024-11-14 08:29:37 +01:00