rubocop-sorted_methods_by_call 1.2.1 → 1.2.3

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: a04b5916bbf8e91aa2792283ad7f15dc939907cb55e6fafec2f77e2cf966b6ff
4
- data.tar.gz: 4f1475d1b0a3a5233b7f15010ae850dab4e696be9b209782d41d44cd5f1b3318
3
+ metadata.gz: e6a9eb4e66de83efb34a68cdac011fc7998f088ac56fd9f84a04e9b3e7e1a940
4
+ data.tar.gz: 7e920b6912bde4e32907e06336d21f141b79120021cb55a8270b46702a76d37d
5
5
  SHA512:
6
- metadata.gz: 2bea6384c391d4a19a1cf83fb8ac9cb671d3325daeda8685d169c52ee8c1906e1f921b1da96a9ba128305b62bc99aaaf2d99567a8e5a9ea9aebd6630efb73383
7
- data.tar.gz: d3cb6250866427b62ca907a9a4c73f8f30c69e94e6d9f767f105851394abb12d8444ac1e691f83df32f05abd1c40d09bf9da272e66d4dc0a1167dba439dcd83b
6
+ metadata.gz: af5acc7e6abc9e29ee7512892a129acd131c61a67641116b802dd106eb1e237005ddbe2953dc941270032a6a897adc9c39f24951d96d52f0abc55d632d5ff5f6
7
+ data.tar.gz: 762aba605e5cf9a40c03d0c15fe68d2d4c4fb9855d2bb1dacd11d6d877990d729f449bbb620f3d711f6291900e8746a1f970fb7fbd06130b0de4f6378de139b9
data/.rubocop.yml CHANGED
@@ -5,11 +5,14 @@ plugins:
5
5
  - rubocop-rspec
6
6
 
7
7
  AllCops:
8
- TargetRubyVersion: 3.4
8
+ TargetRubyVersion: 2.7
9
9
  NewCops: enable
10
10
 
11
11
  Layout/LineLength:
12
12
  Max: 120
13
+ AllowedPatterns:
14
+ - '\A\s*# \+'
15
+ - '@(param|return) \['
13
16
 
14
17
  Naming/FileName:
15
18
  Exclude:
data/.rubocop_todo.yml CHANGED
@@ -1,69 +1,14 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-01-13 11:42:57 UTC using RuboCop version 1.81.7.
3
+ # on 2026-06-11 20:55:54 UTC using RuboCop version 1.82.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 7
9
+ # Offense count: 6
10
10
  # Configuration parameters: EnforcedStyle, AllowedGems.
11
11
  # SupportedStyles: Gemfile, gems.rb, gemspec
12
12
  Gemspec/DevelopmentDependencies:
13
13
  Exclude:
14
14
  - 'rubocop-sorted_methods_by_call.gemspec'
15
-
16
- # Offense count: 1
17
- # Configuration parameters: Severity.
18
- Gemspec/RequiredRubyVersion:
19
- Exclude:
20
- - 'rubocop-sorted_methods_by_call.gemspec'
21
-
22
- # Offense count: 5
23
- # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
24
- Metrics/AbcSize:
25
- Max: 78
26
-
27
- # Offense count: 1
28
- # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
29
- # AllowedMethods: refine
30
- Metrics/BlockLength:
31
- Max: 36
32
-
33
- # Offense count: 4
34
- # Configuration parameters: AllowedMethods, AllowedPatterns.
35
- Metrics/CyclomaticComplexity:
36
- Max: 35
37
-
38
- # Offense count: 9
39
- # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
40
- Metrics/MethodLength:
41
- Max: 70
42
-
43
- # Offense count: 2
44
- # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
45
- Metrics/ParameterLists:
46
- Max: 6
47
-
48
- # Offense count: 3
49
- # Configuration parameters: AllowedMethods, AllowedPatterns.
50
- Metrics/PerceivedComplexity:
51
- Max: 37
52
-
53
- # Offense count: 21
54
- # Configuration parameters: CountAsOne.
55
- RSpec/ExampleLength:
56
- Max: 37
57
-
58
- # Offense count: 1
59
- # Configuration parameters: AllowedGroups.
60
- RSpec/NestedGroups:
61
- Max: 4
62
-
63
- # Offense count: 2
64
- # This cop supports safe autocorrection (--autocorrect).
65
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
66
- # SupportedStyles: single_quotes, double_quotes
67
- Style/StringLiterals:
68
- Exclude:
69
- - 'spec/rubocop/cop/sorted_methods_by_call/waterfall_spec.rb'
data/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # Changelog
2
+
3
+ ## [1.2.3] - 2026-06-12
4
+
5
+ ### Added
6
+ - RBS type signatures for all source files (`sig/`)
7
+ - Steep type checker integration (`Steepfile`, `steep check` in CI)
8
+ - RBS collection via `rbs collection install`
9
+ - Patch stub for `RuboCop::Cop::AutoCorrector` (RBS collection places it in wrong namespace)
10
+ - Docscribe documentation for all ~50 methods with meaningful descriptions
11
+ - `docscribe.yml` configuration
12
+ - `docscribe lib` step in CI
13
+ - RBS validation + Steep check in CI (Ruby >= 3.2)
14
+ - CONTRIBUTING.md, SECURITY.md, issue/PR templates
15
+ - CHANGELOG.md
16
+
17
+ ### Changed
18
+ - Gemfile: `rbs` and `steep` in `:rbs` group, conditional on Ruby >= 3.2
19
+ - CI: manual `bundle install` (no `bundler-cache`) for cross-Ruby compatibility
20
+ - CI: split RBS/steep checks into conditional steps
21
+
22
+ ### Fixed
23
+ - `CODE_OF_CONDUCT.md`: replaced placeholder email with link to GitHub Issues
24
+
25
+ ## [1.2.2] - 2026-06-11
26
+
27
+ ### Changed
28
+ - Updated version to 1.2.2
29
+
30
+ ## [1.2.1] - 2026-06-11
31
+
32
+ ### Changed
33
+ - Updated version to 1.2.1
34
+
35
+ ## [1.2.0] - 2026-06-11
36
+
37
+ ### Added
38
+ - Initial release of RuboCop::SortedMethodsByCall
39
+ - Waterfall ordering enforcement cop
40
+ - Autocorrect support
41
+ - Sibling ordering with cycle detection
42
+ - `SkipCyclicSiblingEdges` configuration option
data/CODE_OF_CONDUCT.md CHANGED
@@ -39,7 +39,7 @@ This Code of Conduct applies within all community spaces, and also applies when
39
39
 
40
40
  ## Enforcement
41
41
 
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by creating an issue in the repository at https://github.com/unurgunite/rubocop-sorted_methods_by_call/issues All complaints will be reviewed and investigated promptly and fairly.
43
43
 
44
44
  All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
45
 
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,38 @@
1
+ # Contributing
2
+
3
+ Bug reports and pull requests are welcome!
4
+
5
+ ## Getting Started
6
+
7
+ 1. Fork the repository
8
+ 2. Clone your fork: `git clone git@github.com:YOUR_USERNAME/rubocop-sorted_methods_by_call.git`
9
+ 3. Install dependencies: `bin/setup`
10
+
11
+ ## Making Changes
12
+
13
+ 1. Create a feature branch: `git checkout -b feature/amazing-feature`
14
+ 2. Make your changes
15
+ 3. Run the test suite: `bundle exec rspec`
16
+ 4. Run the linter: `bundle exec rubocop`
17
+ 5. If you changed RBS signatures, run: `bundle exec rbs validate && bundle exec steep check`
18
+ 6. Commit your changes: `git commit -am 'Add amazing feature'`
19
+ 7. Push: `git push origin feature/amazing-feature`
20
+ 8. Open a pull request
21
+
22
+ ## Code Style
23
+
24
+ - Follow the existing code style
25
+ - All code must pass RuboCop (no offenses)
26
+ - Methods should be documented with YARD comments
27
+ - If adding or changing types, update the corresponding RBS signatures in `sig/`
28
+
29
+ ## Testing
30
+
31
+ - All pull requests must maintain or improve test coverage
32
+ - Run `bundle exec rspec` to run the test suite
33
+ - Run `bundle exec rubocop` to check code style
34
+ - On Ruby >= 3.2, also run `bundle exec rbs validate && bundle exec steep check`
35
+
36
+ ## License
37
+
38
+ By contributing, you agree that your contributions will be licensed under the MIT License.
data/README.md CHANGED
@@ -36,6 +36,11 @@
36
36
  - **Full RuboCop integration**: Works seamlessly with modern RuboCop plugin system;
37
37
  - **Comprehensive scope support**: Classes, modules, singleton classes, and top-level;
38
38
 
39
+ > [!NOTE]
40
+ > This gem implements **true waterfall ordering** that considers the complete call graph across all methods in
41
+ > a scope. Methods are ordered so that every callee appears after all of its callers, creating a natural top-down
42
+ > reading flow.
43
+
39
44
  ## Installation
40
45
 
41
46
  Add this line to your application's Gemfile:
@@ -93,7 +98,6 @@ In waterfall ordering, **callers come before callees**. This creates a top-down
93
98
  before implementation details.
94
99
 
95
100
  ```ruby
96
-
97
101
  class Service
98
102
  def call
99
103
  foo
@@ -119,7 +123,6 @@ end
119
123
  ### Bad Code (violates waterfall order)
120
124
 
121
125
  ```ruby
122
-
123
126
  class Service
124
127
  def call
125
128
  foo
@@ -261,9 +264,3 @@ The gem is available as open source under the terms of MIT License.
261
264
  ## Code of Conduct
262
265
 
263
266
  Everyone interacting with this project is expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md).
264
-
265
- ---
266
-
267
- > **Note**: This gem implements **true waterfall ordering** that considers the complete call graph across all methods in
268
- > a scope. Methods are ordered so that every callee appears after all of its callers, creating a natural top-down
269
- > reading flow.
data/SECURITY.md ADDED
@@ -0,0 +1,9 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ If you discover a security vulnerability, please open an issue at:
6
+
7
+ https://github.com/unurgunite/rubocop-sorted_methods_by_call/issues
8
+
9
+ We will review and address it as soon as possible.
data/Steepfile ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ target :lib do
4
+ check 'lib'
5
+ signature 'sig'
6
+ end
data/config/default.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  SortedMethodsByCall/Waterfall:
2
2
  Description: "Enforces method ordering based on call relationships."
3
3
  Enabled: true
4
- VersionAdded: "1.2.1"
4
+ VersionAdded: "1.2.2"
5
5
  SafeAutoCorrect: false
6
6
  AllowedRecursion: true
7
7
  SkipCyclicSiblingEdges: false
data/docscribe.yml ADDED
@@ -0,0 +1,18 @@
1
+ ---
2
+ rbs:
3
+ enabled: true
4
+ sig_dirs: ["sig"]
5
+ collection_dirs:
6
+ - ".gem_rbs_collection/rubocop-ast/1.46"
7
+ - ".gem_rbs_collection/rubocop/1.57"
8
+ - ".gem_rbs_collection/parser/3.2"
9
+ - ".gem_rbs_collection/ast/2.4"
10
+ collapse_generics: false
11
+
12
+ emit:
13
+ header: false
14
+ include_default_message: true
15
+ include_param_documentation: true
16
+
17
+ inference:
18
+ fallback_type: "Object"