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

Allow comments followed by an attribute #96

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

andrewnicols
Copy link
Contributor

Per PER-2.0:

If a comment docblock is present on a structure that also includes an
attribute, the comment block MUST come first, followed by any
attributes, followed by the structure itself. There MUST NOT be any
blank lines between the docblock and attributes, or the attributes and
the structure.

https://www.php-fig.org/per/coding-style/#122-placement

Other more attribute-specific Sniffs should test for Attributes and their correctness, but this comment sniff should not add false positives.

Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9f0b0c1) 96.59% compared to head (5b915e4) 96.61%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #96      +/-   ##
============================================
+ Coverage     96.59%   96.61%   +0.01%     
- Complexity      536      537       +1     
============================================
  Files            23       23              
  Lines          1527     1536       +9     
============================================
+ Hits           1475     1484       +9     
  Misses           52       52              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@stronk7 stronk7 left a comment

Choose a reason for hiding this comment

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

Thanks @andrewnicols, looks good!

Per PER-2.0:

> If a comment docblock is present on a structure that also includes an
> attribute, the comment block MUST come first, followed by any
> attributes, followed by the structure itself. There MUST NOT be any
> blank lines between the docblock and attributes, or the attributes and
> the structure.

https://www.php-fig.org/per/coding-style/#122-placement

Other more attribute-specific Sniffs should test for Attributes and
their correctness, but this comment sniff should not add false
positives.
@stronk7 stronk7 force-pushed the inlineCommentForAttribute branch from 9175489 to 5b915e4 Compare February 5, 2024 16:38
@stronk7 stronk7 merged commit fc409da into moodlehq:main Feb 5, 2024
8 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