Skip to content

apply flake8 to tests#6629

Merged
oliver-sanders merged 7 commits intocylc:masterfrom
wxtim:tests.flake8
Feb 27, 2025
Merged

apply flake8 to tests#6629
oliver-sanders merged 7 commits intocylc:masterfrom
wxtim:tests.flake8

Conversation

@wxtim
Copy link
Copy Markdown
Member

@wxtim wxtim commented Feb 24, 2025

Apply basic Flake 8 standards to the tests.

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Change to the linting of the tests, so no test changes, doc changes, changelog entries are required.
  • Raised against master because it's a biggish change. Happy to rebase.

@wxtim wxtim added the small label Feb 24, 2025
@wxtim wxtim requested a review from oliver-sanders February 24, 2025 16:46
@wxtim wxtim self-assigned this Feb 24, 2025
tox.ini Outdated
Comment on lines +22 to +26
tests/*: A001, A003, B010, B017, B904, C401, C405, C408, C413, C416, C420, E731, TC001, TC002, TC003, ISC001, N400, SIM117, SIM201, SIM203, SIM300


; for clarity we don't merge 'with Conf():' context trees
tests/unit/parsec/*: SIM117, TC001, TC002, TC003
tests/unit/parsec/*: B017, B904, C408, C413, SIM113, SIM117, TC001, TC002, TC003
Copy link
Copy Markdown
Member

@oliver-sanders oliver-sanders Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than ignoring specific codes, can we just ignore the flake8 extensions as a whole.

E.g:

tests/*: SIM

Rather than:

tests/*: SIM201, SIM203, SIM300

Suggest only using the default flake8 codes for the tests (i.e. turning off all the extensions).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except Bugbear 904, apparently.

…ative imports. Added explanation of B904 needing an explicit exception to tox.ini
Copy link
Copy Markdown
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice clean-up.

(I did a pretty quick pass through, but I think that's enough - it's just tweaking tests, mainly syntax, and they're all passing).

@oliver-sanders oliver-sanders merged commit 0e5fa06 into cylc:master Feb 27, 2025
27 checks passed
@wxtim wxtim deleted the tests.flake8 branch March 4, 2025 16:38
wxtim added a commit to wxtim/cylc that referenced this pull request Mar 5, 2025
…n_cylc_show

* upstream/master: (27 commits)
  tui: open log files in external application (cylc#6611)
  fix typo in stop.py - options.max_poll -> options.max_polls
  schema: add first-parent descendants (cylc#6610)
  doc: improve NamespaceIDGlob description (cylc#6637)
  Document that "ex" prefix means "exclude" [skip ci]
  tests: remove string templating in SQL statements (cylc#6631)
  Merge pull request cylc#6629 from wxtim/tests.flake8
  Remove vestiges of authorisation layer removed in cylc#3845
  Bump dev version
  Prepare release 8.4.1
  Merge pull request cylc#6578 from MetRonnie/graphql-err-handling
  Add test
  Update cylc/flow/etc/examples/expiry/index.rst
  Correct type annotations
  Fix duplicate task triggers
  Add test for duplicate task triggers
  Pytest: full verbosity for assertions
  Fix test picking up user global config
  Wrapper script: fix `PATH` override preventing selection of Cylc version in GUI under Cylc Hub
  Get poll to return task failure if job/log has been removed. (cylc#6577)
  ...
@MetRonnie MetRonnie mentioned this pull request Mar 12, 2025
@wxtim wxtim changed the title basic flake8 stuff apply flake8 to tests Mar 13, 2025
MetRonnie pushed a commit to MetRonnie/cylc-flow that referenced this pull request Apr 3, 2025
Run flake8 on the python tests.
wxtim added a commit that referenced this pull request Apr 7, 2025
Cherry pick #6629 - use Flake8 on tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants