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

Apply TOR901 only to files in test dir #54

Open
kit1980 opened this issue Apr 29, 2024 · 1 comment
Open

Apply TOR901 only to files in test dir #54

kit1980 opened this issue Apr 29, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@kit1980
Copy link
Contributor

kit1980 commented Apr 29, 2024

See pytorch/pytorch#125050 for details.

This will require passing file path as an input to the rules.
In general it doesn't make too much sense, but for PyTorch-internal rule like TOR901 where we know the path in the CI this will allow to remove long enumerations of files to ignore from .flake8

@sbrugman
Copy link
Collaborator

sbrugman commented Sep 9, 2024

For reference, ruff has a option of opting out certain rules for a given pattern - which I think works quite well:

A list of mappings from file pattern to rule codes or prefixes to exclude, when considering any matching files. An initial '!' negates the file pattern.

https://docs.astral.sh/ruff/settings/#lint_per-file-ignores

@sbrugman sbrugman added the enhancement New feature or request label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants