Skip to content

Commit

Permalink
Allow non-rogue sigil comments in docs
Browse files Browse the repository at this point in the history
This allows examples to include `# rubocop:disable`, while still
catching rogue comments.
  • Loading branch information
sambostock committed Apr 24, 2023
1 parent e1c59db commit 166eb19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/documentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
context(Pathname.new(path).relative_path_from(root_directory)) do
it "does not contain any rogue `rubocop:___` comments" do
contents = File.read(path)
expect(contents).not_to(match(/rubocop:(?:todo|disable)/))
expect(contents).not_to(match(/^(?:#?\s*)rubocop:(?:todo|disable)/))
end
end
end
Expand Down

0 comments on commit 166eb19

Please sign in to comment.