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

Support lint ignore directives in more places #441

Merged
merged 2 commits into from
Apr 20, 2024

Conversation

amyreese
Copy link
Member

@amyreese amyreese commented Apr 20, 2024

Stack from ghstack (oldest at bottom):

Adds logic to LintRule.node_comments() looking for directives in more
locations relative to the current node:

  • trailing inline comments after commas
  • preceding and trailing comments inside brackets
  • preceding comments before/after decorators for classes and functions

In addition, to better support suppressions for decorators themselves,
the logic to break upward searching until reaching a leading_lines
node has been modified to exclude Decorator nodes which have their own
leading lines that aren't used for the first decorator on a class.

Based on code examples reported in #413

[ghstack-poisoned]
@amyreese amyreese requested a review from zsol as a code owner April 20, 2024 01:33
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 20, 2024
[ghstack-poisoned]
@amyreese amyreese linked an issue Apr 20, 2024 that may be closed by this pull request
@amyreese amyreese merged commit 4d59616 into gh/amyreese/1/base Apr 20, 2024
16 checks passed
amyreese added a commit that referenced this pull request Apr 20, 2024
Adds logic to `LintRule.node_comments()` looking for directives in more
locations relative to the current node:

- trailing inline comments after commas
- preceding and trailing comments inside brackets
- preceding comments before/after decorators for classes and functions

In addition, to better support suppressions for decorators themselves,
the logic to break upward searching until reaching a `leading_lines`
node has been modified to exclude `Decorator` nodes which have their own
leading lines that aren't used for the first decorator on a class.

Based on code examples reported in #413

ghstack-source-id: 4907870d9ecde15fd1110b3d276bc7f95569c513
Pull Request resolved: #441
@amyreese amyreese deleted the gh/amyreese/1/head branch April 20, 2024 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lint-fixme comments not respected
2 participants