Closed michplunkett closed 6 months ago
I went through and edited all files here so that they pass pre-commit linting and formatting.
@andrewjtdunn @jchristensonCHI There are functions that are marked as too complex that I added the # noqa: C901 marker to (so that they would pass the linters) that could be good to consider updating if there is time for a refactor.
civiclens/collect/access_api_data.py:100:5: C901
pull_reg_gov_datais too complex (17 > 10) civiclens/regulations/views.py:23:5: C901
search_resultsis too complex (12 > 10)
@andrewjtdunn @GregoryHo88 I made some changes to avoid line length issues that broke some test assert statements. I'm looking into the tests to try to solve those issues but may have questions on the tests. In general, wanted you two to be aware of what kind of issues weren't being raised before in linting that are being raised now.
After this is merged to main, anyone that pulls these updates should be able to have their linting pass, and pre-commit hooks will be run automatically on pushes and PRs as well as when a commit is made (if you've installed precommit). This will avoid any future formatting issues blocking PRs especially as we ramp up the pace of coding here at the end.
@abejburton Just a fyi, the function that the linter is flagging in views.py is the one I specifically showed to James on Friday that he approved and said looked good (the minor changes he recommended of adding a decorator and possibly changing the order of an if/else statement would not fix this)
@jchristensonCHI great, we'll leave that function with # noqa then
pre-commit
is now running instead of onlyruff
.