Skip to content

Commit

Permalink
Add NOTE to keywords of Style/CommentAnnotation
Browse files Browse the repository at this point in the history
This PR adds `# NOTE: ` annotation that is occasionally used
to keywords of `Style/CommentAnnotation`.
  • Loading branch information
koic authored and bbatsov committed Nov 10, 2020
1 parent 80fbacc commit c1f754f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
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

0 comments on commit c1f754f

Please sign in to comment.