You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the new exclude option to the format and lint section to exclude a set of files for a specific tool only. Respect the new option in the check, fix, and format commands.
The text was updated successfully, but these errors were encountered:
@charliermarsh any advice on how to implement this? It seems that python_files_in_path is doing all the exclusions now. Should we just add an early check in one of the lint commands that returns immediately if the file is excluded?
@MichaReiser - Yeah, that would be my suggestion: python_files_in_path applies the top-level filters, then we apply any further filters in lint. It's kind of similar to per-file-ignores: we filter down the global rule set based on the ignore setting, but we then apply any per-file-ignores after collecting diagnostics, on a per-file basis.
We may also want to make sure that these files don't get formatted on save in the IDE. @charliermarsh does ruff lint files in the IDE that are not part of include or exclude?
Adding exclude to lint will be somewhat challenging because we use serde's flatten to expose the same options top-level and under the lint keyword. This works perfectly but imposes a challenge now because exclude (and, in the future, the preview flag) conflicts with the top-level exclude setting.
I think what we can try is to have a few more structs 😆
CommonLintOptions: The lint options without exclude (and eventually preview).
LintOptions: Defines the preview option and flattens the CommonLintOptions
Options flattens the CommonLintOptions (instead of LintOptions as of today)
Add the new
exclude
option to theformat
andlint
section to exclude a set of files for a specific tool only. Respect the new option in thecheck
,fix
, andformat
commands.The text was updated successfully, but these errors were encountered: