* Initial plan
* Add pre-commit GitHub workflow and fix linting issues
- Created .github/workflows/pre-commit.yml to run pre-commit hooks in CI
- Fixed mypy type errors in translator.py
- Fixed shellcheck warning in run_anki_generator.sh
- Added per-file ignores for word_frequency module legacy code
- Applied auto-fixes from ruff, ruff-format, autoflake, prettier
- All pre-commit hooks now passing
Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>
* Make Python scripts with shebangs executable
- Set executable bit for word_frequency module scripts with shebangs
- All 30 pre-commit hooks now passing
Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>
* Fix: Restore imports in check functions (autoflake-proof)
- Restored imports in _check_argos(), _check_deep_translator(), _check_langdetect()
- Used _ = module assignment to prevent autoflake from removing imports
- These imports test module availability by triggering ImportError if missing
- All 30 pre-commit hooks now passing
Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com>
Features:
- Generate music from text prompts using open-source MusicGen model
- Support for small/medium/large models (500MB to 6.5GB)
- CUDA, Apple Silicon MPS, and CPU support
- Interactive mode with example prompts
- Setup script that handles venv and GPU detection
Usage:
cd python_pkg/music_gen && ./setup.sh
python music_generator.py 'upbeat electronic dance music'
- Optimize slow tests (3.5s -> 0.4s):
- Mock threading.Thread instead of spawning real threads
- Use PropertyMock instead of generator-based exception
- Simplify coverage config:
- Set source to '.' to check all Python files
- Remove exclude_lines (no special exclusions needed)
- 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
- 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
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.
- Added constants for HTTP status codes (using http.HTTPStatus)
- Added validation limit constants in screen_locker
- Added centipawn loss threshold constants in chess analysis
- Added various other domain-specific constants across 9 files
- Added module docstrings to 19 Python files
- Added class docstrings to 5 classes (ScreenLocker, PokerModifierApp, etc.)
- Added method docstrings to 22 methods
- Added function docstrings to 25 functions
- Added __init__ docstrings to 5 classes
- Removed D100-D107 from ruff ignore list (docstrings now enforced)
- Removed deprecated ANN101, ANN102, UP038 rules from ignore list
- Fixed UP038: use union types in isinstance() calls
- All ruff checks now pass with full docstring enforcement
- Converted 67 print statements to logging across 11 files
- Added logging.basicConfig(level=logging.INFO) to each file
- Used appropriate log levels: info, warning, error, exception
- Removed T201 from ruff ignore list to enforce logging usage