Repository navigation
Conversation
Accept valid JSON config files with any extension or no extension, while preserving BOM support and malformed-content errors. Add regression coverage for filenames, encodings, and invalid JSON. Fixes ReadAlongs#140.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #315 +/- ##
==========================================
- Coverage 93.76% 93.76% -0.01%
==========================================
Files 21 21
Lines 1765 1763 -2
Branches 295 294 -1
==========================================
- Hits 1655 1653 -2
Misses 73 73
Partials 37 37 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Nice. The code looks good, and thanks for adding good unit tests. I'll test interactively before finishing my review. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Goal?
Accept valid JSON configuration files regardless of their filename. Keep BOM support and report malformed JSON through the existing CLI error.
Fixes?
Fixes #140.
Feedback sought?
Review of the filename-independent configuration loading and regression cases.
Priority?
Normal; small CLI reliability fix.
Tests added?
Eight cases cover
.json,.JSON,.cfg, and extensionless filenames with UTF-8 and UTF-8 BOM content. The invalid-configuration test now checks the JSON-content diagnostic for both.jsonand.txtfiles.How to test?
pytest tests/test_align_cli.py -q -k 'config_contents_determine_format or invalid_config'The focused tests fail on the original implementation (7 failures, 2 passes) and pass after the fix (9 passes). Applicable formatting, lint, and type-check hooks pass.
A broader offline run with
pytest --disable-socket --allow-unix-socket --ignore=tests/test_audio.pygives 137 passes and the same 9 network-dependent failures seen on the untouched baseline (129 passes).pytest-socketwas installed only for this local check; no dependency files changed. The audio module was excluded because its CLI subprocesses do not inherit that network guard. The full network-dependent suite and other supported Python/platform combinations remain for CI.Confidence?
High for this narrow change. Additional local checks cover malformed JSON, missing files, Unicode filenames, and real alignment with BOM/non-ASCII configuration content.
Version change?
Patch release; no version files changed.