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

Add NOTE to keywords of Style/CommentAnnotation #9022

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#9022](https://github.com/rubocop-hq/rubocop/issues/9022): Add `NOTE` to keywords of `Style/CommentAnnotation`. ([@koic][])
5 changes: 3 additions & 2 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2898,17 +2898,18 @@ Style/CommandLiteral:
Style/CommentAnnotation:
Description: >-
Checks formatting of special comments
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
(TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE).
StyleGuide: '#annotate-keywords'
Enabled: true
VersionAdded: '0.10'
VersionChanged: '0.31'
VersionChanged: '1.3'
Keywords:
- TODO
- FIXME
- OPTIMIZE
- HACK
- REVIEW
- NOTE

Style/CommentedKeyword:
Description: 'Do not place comments on the same line as certain keywords.'
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/cops_style.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ folders = %x(find . -type d).split
| Yes
| Yes
| 0.10
| 0.31
| 1.3
|===

This cop checks that comment annotation keywords are written according
Expand Down Expand Up @@ -1778,7 +1778,7 @@ annotation.
| Name | Default value | Configurable values

| Keywords
| `TODO`, `FIXME`, `OPTIMIZE`, `HACK`, `REVIEW`
| `TODO`, `FIXME`, `OPTIMIZE`, `HACK`, `REVIEW`, `NOTE`
| Array
|===

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/commissioner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def trigger_restricted_cops(event, node)
end
end

# Note: mutates `callbacks` in place
# NOTE: mutates `callbacks` in place
def restricted_map(callbacks)
map = {}
callbacks&.select! do |cop|
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Cop
# and spec file when given a valid qualified cop name.
# @api private
class Generator
# Note: RDoc 5.1.0 or lower has the following issue.
# NOTE: RDoc 5.1.0 or lower has the following issue.
# https://github.com/rubocop-hq/rubocop/issues/7043
#
# The following `String#gsub` can be replaced with
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cli/cli_options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ class SomeCop < Cop
expect(cli.run(['--format', 'offenses',
'--except', 'Style/IfUnlessModifier,Lint',
'example.rb'])).to eq(1)
# Note: No Lint/UselessAssignment offense.
# NOTE: No Lint/UselessAssignment offense.
expect($stdout.string)
.to eq(<<~RESULT)

Expand Down