rubocop-obsession 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47b14b8bd67398fccc5f92ba6e3e5b30bd76a47ec28a38694183cac973de17e4
4
- data.tar.gz: bc60b8d77b8a2353abf4d0d3025161b5c581405507ecbe946f6401e9e3665951
3
+ metadata.gz: 9bfae7e0b1e495fad34ada943845fd9399fe6763dd0b6eca0a946f87754ba4a2
4
+ data.tar.gz: 1651b96c4cd6ace35e62dfc968ec4dd8b690118c1b7e8aa5432abd59e5e0b8ad
5
5
  SHA512:
6
- metadata.gz: db8e7698d91d0ab2ef5cb95236164ac2bb0dc754944082c3705d88d87cf99ed1d8bb620cefba7e7817dcfc622d951aca9ee38be76fec566d7a6644a9a1bed111
7
- data.tar.gz: 744cc5411803bdf92075645b9aa53d50133078f8491c0edc6bbade699805141b72297b1acabc85ed5321a1cc70a86282d5458bd5eb7df0483174211f153f7250
6
+ metadata.gz: a0dd211e0748686195f25c2505aeef9baecae83e1648a4c7ddddf011a31e1de94e5e6cb239a6d8e67e3bf55b39c766af8e5d19f55aec70213993f7d7ae0dbea8
7
+ data.tar.gz: 2e427f1f22dca52e0c417b53c8e5b390aaaf801335d379e888a8131dd7b3e005abe0a32628e1efd9dbe9af4ab3ef749edb38ebb4143c634b74c5ffeff0385bd8
data/config/default.yml CHANGED
@@ -3,7 +3,7 @@ Obsession/MethodOrder:
3
3
  Obsession/NoBreakOrNext:
4
4
  Enabled: false
5
5
  Exclude:
6
- - 'script/db/**/*'
6
+ - 'script/**/*'
7
7
  Obsession/NoParagraphs:
8
8
  Enabled: false
9
9
  Exclude:
@@ -15,7 +15,7 @@ Obsession/TooManyParagraphs:
15
15
  Enabled: false
16
16
  Exclude:
17
17
  - 'db/migrate/*'
18
- - 'script/db/**/*'
18
+ - 'script/**/*'
19
19
  - 'spec/**/*'
20
20
 
21
21
  Obsession/Graphql/MutationName:
@@ -22,7 +22,7 @@ module RuboCop
22
22
  # class TrackEvent < Base
23
23
  # end
24
24
  # end
25
- class MutationName < Cop
25
+ class MutationName < Base
26
26
  include Helpers
27
27
 
28
28
  MSG = 'Mutation name should start with a verb.'
@@ -59,7 +59,7 @@ module RuboCop
59
59
  # end
60
60
  # end
61
61
  # end
62
- class NoBreakOrNext < Cop
62
+ class NoBreakOrNext < Base
63
63
  BIG_LOOP_MSG =
64
64
  'Avoid `break`/`next` in big loop, decompose into private method or rethink loop.'
65
65
  NO_NEXT_MSG = 'Avoid `next` in loop, use conditions or rethink loop.'
@@ -8,7 +8,7 @@ module RuboCop
8
8
  # If your method code has many instructions that are not organized into
9
9
  # paragraphs, you should break it up into multiple paragraphs to make the
10
10
  # code more breathable and readable. The 3 possible paragraphs themes
11
- # always are: initialization, action, and result.
11
+ # could be: initialization, action, and result.
12
12
  #
13
13
  # @example
14
14
  #
@@ -33,7 +33,7 @@ module RuboCop
33
33
  #
34
34
  # Rails.logger.info('Content has been set')
35
35
  # end
36
- class NoParagraphs < Cop
36
+ class NoParagraphs < Base
37
37
  MSG = 'Method has many instructions and should be broken up into paragraphs.'
38
38
  MAX_CONSECUTIVE_INSTRUCTIONS_ALLOWED = 5
39
39
 
@@ -11,7 +11,7 @@ module RuboCop
11
11
  # stale TODOs. Sometimes developers really mean to work on their TODOs
12
12
  # soon, but then Product re-prioritizes their work, or the developer
13
13
  # leaves the company, and never gets a chance to tackle them.
14
- class NoTodos < Cop
14
+ class NoTodos < Base
15
15
  MSG = 'Avoid TODO comment, create a task in your project management tool instead.'
16
16
  KEYWORD_REGEX = /(^|[^\w])(TODO|FIXME|OPTIMIZE|HACK)($|[^\w])/i
17
17
 
@@ -16,7 +16,7 @@ module RuboCop
16
16
  # # good
17
17
  # after_create :notify_followers
18
18
  # after_create :send_stats
19
- class CallbackOneMethod < Cop
19
+ class CallbackOneMethod < Base
20
20
  include Helpers
21
21
 
22
22
  MSG = 'Declare only one method per callback definition.'
@@ -26,7 +26,7 @@ module RuboCop
26
26
  # :jsonb,
27
27
  # default: [],
28
28
  # comment: "Example: [{ 'name': 'ruby' }, { 'name': 'python' }]"
29
- class FullyDefinedJsonField < Cop
29
+ class FullyDefinedJsonField < Base
30
30
  def_node_matcher :json_field?, <<~PATTERN
31
31
  (send nil? :add_column _ _ (sym {:json :jsonb}) ...)
32
32
  PATTERN
@@ -21,7 +21,7 @@ module RuboCop
21
21
  # def change
22
22
  # add_belongs_to :blog_posts, :user
23
23
  # end
24
- class MigrationBelongsTo < Cop
24
+ class MigrationBelongsTo < Base
25
25
  def_node_matcher :add_reference?, <<~PATTERN
26
26
  (send nil? :add_reference ...)
27
27
  PATTERN
@@ -29,7 +29,7 @@ module RuboCop
29
29
  # return if !rss_changed?
30
30
  # ...
31
31
  # end
32
- class NoCallbackConditions < Cop
32
+ class NoCallbackConditions < Base
33
33
  MSG =
34
34
  'Avoid condition in callback declaration, move it inside the callback method instead.'
35
35
 
@@ -27,7 +27,7 @@ module RuboCop
27
27
  # def load_blog_post
28
28
  # ...
29
29
  # end
30
- class PrivateCallback < Cop
30
+ class PrivateCallback < Base
31
31
  include VisibilityHelp
32
32
  include Helpers
33
33
 
@@ -13,7 +13,7 @@ module RuboCop
13
13
  # of the DB migration. The reason should be detailed and reviewed by a
14
14
  # knowledgeable PR reviewer. Failure to follow instructions may bring your
15
15
  # app down.
16
- class SafetyAssuredComment < Cop
16
+ class SafetyAssuredComment < Base
17
17
  MSG =
18
18
  'Add `# Safe because <reason>` comment above safety_assured. ' \
19
19
  'An invalid reason may bring the site down.'
@@ -13,7 +13,7 @@ module RuboCop
13
13
  #
14
14
  # # good
15
15
  # after_create_commit :send_email
16
- class ShortAfterCommit < Cop
16
+ class ShortAfterCommit < Base
17
17
  MSG = 'Use shorter %<prefer>s'
18
18
 
19
19
  def_node_matcher :after_commit?, '(send nil? :after_commit ...)'
@@ -13,7 +13,7 @@ module RuboCop
13
13
  #
14
14
  # # good
15
15
  # validate :validate_url
16
- class ShortValidate < Cop
16
+ class ShortValidate < Base
17
17
  MSG = 'The `on:` argument is not needed in this validate.'
18
18
 
19
19
  def_node_matcher :validate_with_unneeded_on?, <<~PATTERN
@@ -16,7 +16,7 @@ module RuboCop
16
16
  # # good
17
17
  # validates :name, presence: true
18
18
  # validates :status, presence: true
19
- class ValidateOneField < Cop
19
+ class ValidateOneField < Base
20
20
  MSG = 'Validate only one field per line.'
21
21
 
22
22
  def_node_matcher :validates_with_more_than_one_field?, <<~PATTERN
@@ -13,7 +13,7 @@ module RuboCop
13
13
  #
14
14
  # # good
15
15
  # validate :validate_at_least_one_admin
16
- class ValidationMethodName < Cop
16
+ class ValidationMethodName < Base
17
17
  MSG = 'Prefix custom validation method with validate_'
18
18
 
19
19
  def_node_matcher :on_validate_callback, <<~PATTERN
@@ -37,7 +37,7 @@ module RuboCop
37
37
  # ...
38
38
  # end
39
39
  # end
40
- class DescribePublicMethod < Cop
40
+ class DescribePublicMethod < Base
41
41
  MSG = 'Only test public methods.'
42
42
 
43
43
  def_node_matcher :on_context_method, <<-PATTERN
@@ -6,13 +6,13 @@ module RuboCop
6
6
  # This cop checks for methods with too many paragraphs.
7
7
  #
8
8
  # You should organize your method code into 2 to 3 paragraphs maximum.
9
- # The 3 possible paragraphs themes always are: initialization, action,
9
+ # The 3 possible paragraphs themes could be: initialization, action,
10
10
  # and result. Shape your paragraph according to those themes. Spec code
11
11
  # should also be organized into 2 to 3 paragraphs
12
12
  # (initialization/action/result or given/when/then paragraphs).
13
13
  #
14
- # After organizing your paragraphs, if they are too long or dense, it is
15
- # a sign that you should break your code into smaller methods.
14
+ # After organizing your paragraphs, if they are too long or dense, it
15
+ # could be a sign that they should be broken into smaller methods.
16
16
  #
17
17
  # @example
18
18
  #
@@ -39,7 +39,7 @@ module RuboCop
39
39
  #
40
40
  # Rails.logger.info('Content has been set')
41
41
  # end
42
- class TooManyParagraphs < Cop
42
+ class TooManyParagraphs < Base
43
43
  MSG = 'Organize method into 2 to 3 paragraphs (init, action, result).'
44
44
  MAX_PARAGRAPHS = 3
45
45
 
@@ -1,5 +1,5 @@
1
1
  module Rubocop
2
2
  module Obsession
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-obsession
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerome Dalbert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-27 00:00:00.000000000 Z
11
+ date: 2024-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport