Repository navigation
Fix the flake8 warnings and make the lint check strict - #263
Merged
Merged
Conversation
CI ran flake8 twice: once for syntax errors and undefined names, and once with --exit-zero for everything else, so about 270 style warnings, nearly all of them in tests.py and doc/conf.py, never failed a build. They are fixed, most of them with autopep8, without changing what the code does. Apart from whitespace and comments, the only changes are a renamed variable and dropped u'' prefixes in two tests, and 'import sys, os' split in two in doc/conf.py. The check is now a single strict run, configured in .flake8 so that it gives the same result locally. It no longer passes --max-complexity=10, which three functions exceed (patch_files, AppendOperation._apply and JsonPatch.apply): splitting them up is not a style fix. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PewzpjVeke4LTQ7Q88nyu6
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.
Stacked on #261 (base branch
claude/inspiring-turing-zftuu5), because that PR already rewrites two places flake8 complained about: the runner at the end oftests.pyand the tab injsonpatch_cli.py. Merge #261 first; GitHub then retargets this PR tomaster.CI ran flake8 twice: once for syntax errors and undefined names, and once with
--exit-zerofor everything else. About 270 style warnings, nearly all intests.pyanddoc/conf.py, therefore never failed a build.Changes
#comment→# comment).test_issue119, rename a variablel, and mark the two deliberate== Nonecomparisons and the lateimport jsonpatchindoc/conf.pywith# noqa.flake8 .run instead of two..flake8with the line length of 127 that CI used, so local runs agree with CI.One thing dropped
The old advisory run passed
--max-complexity=10. Three functions exceed it:patch_files(24),AppendOperation._apply(12) andJsonPatch.apply(11). Splitting them up is not a style fix, so the strict check does not include the complexity limit.Verification
u''prefixes intest_issue119, andimport sys, ossplit in two indoc/conf.py. Checked by comparing the syntax trees of the changed files before and after.flake8 .reports 0;python tests.py(353 tests), pytest andsphinx-build -Wpass on Python 3.13.Generated by Claude Code