Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ruff test-bad-syntax exclusion #697

Merged
merged 1 commit into from
Oct 26, 2023
Merged

Conversation

MichaReiser
Copy link
Contributor

This PR fixes ruff check . which started failing with after moving the exclude to [ruff.lint]

ruff failed
  Cause: TOML parse error at line 2, column 19
  |
2 | requires = ['bad' 'syntax']
  |                   ^
invalid array
expected `]`

ruff.exclude and ruff.lint.exclude have slightly different semantics:

  • ruff.exclude: Excludes files from your project, so that ruff skips them for all commands. This also prevents ruff from loading configuration files in excluded directories.
  • ruff.lint.exclude: Excludes files from linting only. However, ruff loads the files (and related configurations).

You want ruff.lint.exclude to avoid the intentionally malformed configuration.

Question: Could we improve our documentation to make this distinction more clear?

Test Plan

ruff check . no longer fails because of the malformed configuration.

@henryiii henryiii merged commit 8b3155d into pypa:main Oct 26, 2023
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants