File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed
Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ Pattern: Malformed cop directive syntax
2+
3+ Issue: -
4+
5+ ## Description
6+
7+ Checks that ` # rubocop:enable … ` and ` # rubocop:disable … ` statements are strictly formatted.
8+
9+ A comment can be added to the directive by prefixing it with ` -- ` .
10+
11+ ## Examples
12+
13+ ``` ruby
14+ # bad
15+ # rubocop:disable Layout/LineLength Style/Encoding
16+ # ^ missing comma
17+
18+ # bad
19+ # rubocop:disable
20+
21+ # bad
22+ # rubocop:disable Layout/LineLength # rubocop:disable Style/Encoding
23+
24+ # bad
25+ # rubocop:wrongmode Layout/LineLength
26+
27+ # good
28+ # rubocop:disable Layout/LineLength
29+
30+ # good
31+ # rubocop:disable Layout/LineLength, Style/Encoding
32+
33+ # good
34+ # rubocop:disable all
35+
36+ # good
37+ # rubocop:disable Layout/LineLength -- This is a good comment.
38+ ```
39+
40+ ## Further Reading
41+
42+ * [ RuboCop - Lint/CopDirectiveSyntax] ( https://docs.rubocop.org/rubocop/cops_lint.html#lintcopdirectivesyntax )
Original file line number Diff line number Diff line change 1+ Pattern: Missing use of ` ActionController::Parameters#expect `
2+
3+ Issue: -
4+
5+ ## Description
6+
7+ Enforces the use of ` ActionController::Parameters#expect ` as a method for strong parameter handling.
8+
9+ ## Examples
10+
11+ ``` ruby
12+ # bad
13+ params.require(:user ).permit(:name , :age )
14+ params.permit(user: [:name , :age ]).require(:user )
15+
16+ # good
17+ params.expect(user: [:name , :age ])
18+ ```
19+
20+ ## Further Reading
21+
22+ * [ RuboCop - Rails/StrongParametersExpect] ( https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsstrongparametersexpect )
You can’t perform that action at this time.
0 commit comments