# flake8 configuration for this repository. # # Three settings, each with the measurement behind it rather than a preference. # # max-line-length = 160 # 120 was tried first and two lines still exceeded it: the secret-scanner rule table in # scan_leaks.py holds raw regex source of 148 and 156 characters. Splitting a regex inside a raw # string either changes the pattern or forces concatenation that is harder to read than the long # line, so the limit is set from what a real string in this repository needs (156) with a little # room, and a line over 160 is a genuine defect rather than a style disagreement. # # max-complexity is not set, and C901 is excluded below with the measurement: this repository's # parsers and dispatchers reach 21-41 (check_commands.command_findings is 41, a flat if/elif chain # over finding kinds). Setting a threshold above the maximum would be a number chosen to pass rather # than a standard; splitting them into one function per case would move the shape of the format away # from the code that reads it, and looking like the specification is this repository's argument. # The numbers are recorded here so a future pass can decide to refactor with them in hand. # # extend-ignore: # C901 see above -- reported here as a measurement, not enforced # E203 slice whitespace (`data[start : end]`); flake8 and every autoformatter disagree, and the # repository has no autoformatter # # Run from the repository root: # flake8 *.py skills/apk-reverse/scripts/*.py # # Enforced in CI: the `lint` job in .github/workflows/ci.yml runs this exact command alongside mypy, # on a bare interpreter, so the configuration is exercised in the poorest environment it must keep # working in. [flake8] max-line-length = 160 extend-ignore = C901,E203 exclude = .git,__pycache__,tools,build,dist