rubocop-elegant 0.0.2 → 0.0.4

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: 100bd3b91edc18d1b4ccd758ed60c6596b3c9a138f6dfa658fc276fd4ba673e5
4
- data.tar.gz: afb97724cdb00b717601ac8285f32318bd6d7972fe137ba9d0503696364d3f6d
3
+ metadata.gz: a0f20207d2c2b3d6cf14c979f315a67f9be53fb7f3918fca077dc4f0f9a0e0f9
4
+ data.tar.gz: 0d5ff4a396e07cf7324b1b27084345a70b64b7d5dfd80322affdd76a6bdf5201
5
5
  SHA512:
6
- metadata.gz: 075103cdab520aa962845d53c8bede02fa4052f78bcdd6de379400b3ad8df61650725c87c2013ad8175226c14cf07fbfb1116d9f40b3b16bf3de1077aa61d5bc
7
- data.tar.gz: a699d37ec8bf83812fcde3c160e12605d83e2d8f3f75eb7da4c7b0dd8332b2ba33d790cf4fca0adaeec7505c68f401eb47f27602ff694b3b0e82841940e84f13
6
+ metadata.gz: 2066b22308c7a0bb6cf85684a808bd401ee295489d481afefc29410471bdd8f3ba241d4c03b633a50a06cda324720948384e8d77016f74d8a43840183d829314
7
+ data.tar.gz: fd83e920a8c1ea5946b89cdad32979e5d0bceaf256a603749c9c496374f7df80c643488caaeadd27e6c5b02dfaf244507a9f344f5be26df70446ca4b47b3830c
data/README.md CHANGED
@@ -11,6 +11,14 @@
11
11
  [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/rubocop-elegant.svg)](https://codecov.io/github/yegor256/rubocop-elegant?branch=master)
12
12
  [![Hits-of-Code](https://hitsofcode.com/github/yegor256/rubocop-elegant)](https://hitsofcode.com/view/github/yegor256/rubocop-elegant)
13
13
 
14
+ This is a [RuboCop] plugin that enforces
15
+ [Elegant Objects] principles in Ruby code.
16
+ Default RuboCop configuration is too permissive, allowing coding practices
17
+ that lead to unmaintainable code: comments that lie, verbose methods,
18
+ cryptic variable names, and so on.
19
+ This plugin configures existing RuboCop cops with stricter settings
20
+ and adds custom cops for rules that RuboCop doesn't provide out of the box.
21
+
14
22
  First, install it:
15
23
 
16
24
  ```bash
@@ -42,5 +50,5 @@ bundle exec rake
42
50
 
43
51
  If it's clean and you don't see any error messages, submit your pull request.
44
52
 
45
- [rubocop-elegant]: https://www.rubydoc.info/github/yegor256/rubocop-elegant/master/rubocop-elegant
46
- [fluent interface]: https://en.wikipedia.org/wiki/Fluent_interface
53
+ [RuboCop]: https://rubocop.org/
54
+ [Elegant Objects]: https://www.elegantobjects.org/
data/config/default.yml CHANGED
@@ -12,3 +12,68 @@ Elegant/NoEmptyLinesInMethods:
12
12
  Description: 'Disallows empty lines inside method bodies'
13
13
  Enabled: true
14
14
  VersionAdded: '0.0.2'
15
+
16
+ Naming/VariableName:
17
+ ForbiddenPatterns:
18
+ - '[^a-z]'
19
+ - '^.{17,}$'
20
+ Metrics/MethodLength:
21
+ Max: 80
22
+ Metrics/AbcSize:
23
+ Max: 25
24
+ Naming/MethodName:
25
+ ForbiddenPatterns:
26
+ - '[^a-z!?]'
27
+ - '^.{17,}$'
28
+ Style/IfUnlessModifier:
29
+ Enabled: false
30
+ Naming/FileName:
31
+ Regex: '^[a-z0-9\-._]*$'
32
+ Minitest/EmptyLineBeforeAssertionMethods:
33
+ Enabled: false
34
+ Layout/EmptyLineAfterGuardClause:
35
+ Enabled: false
36
+ Layout/RescueEnsureAlignment:
37
+ Enabled: false
38
+ Layout/MultilineMethodCallIndentation:
39
+ Enabled: false
40
+ Layout/EndOfLine:
41
+ EnforcedStyle: lf
42
+ Layout/ParameterAlignment:
43
+ Enabled: false
44
+ Layout/LineLength:
45
+ Max: 120
46
+ Style/MultilineBlockChain:
47
+ Enabled: false
48
+ Style/ClassAndModuleChildren:
49
+ Enabled: false
50
+ Lint/NestedMethodDefinition:
51
+ Enabled: false
52
+ Metrics/ParameterLists:
53
+ Enabled: false
54
+ Layout/MultilineAssignmentLayout:
55
+ Enabled: true
56
+ Style/Documentation:
57
+ Enabled: false
58
+ Style/ClassVars:
59
+ Enabled: false
60
+ Style/RequireOrder:
61
+ Enabled: true
62
+ Style/AutoResourceCleanup:
63
+ Enabled: true
64
+ Style/Send:
65
+ Enabled: true
66
+ Style/StaticClass:
67
+ Enabled: true
68
+ Style/TopLevelMethodDefinition:
69
+ Enabled: true
70
+ Style/ImplicitRuntimeError:
71
+ Enabled: true
72
+ Style/DateTime:
73
+ Enabled: true
74
+ Lint/NumberConversion:
75
+ Enabled: true
76
+ Performance/ChainArrayAllocation:
77
+ Enabled: true
78
+ Performance/OpenStruct:
79
+ Enabled: true
@@ -9,11 +9,11 @@ Gem::Specification.new do |s|
9
9
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
10
10
  s.required_ruby_version = '>=2.2'
11
11
  s.name = 'rubocop-elegant'
12
- s.version = '0.0.2'
12
+ s.version = '0.0.4'
13
13
  s.license = 'MIT'
14
14
  s.summary = 'Set of custom RuboCop cops for elegant Ruby coding'
15
15
  s.description =
16
- 'Explain it here...'
16
+ 'RuboCop plugin enforcing elegant coding style: no comments (except SPDX and magic), no empty lines in methods'
17
17
  s.authors = ['Yegor Bugayenko']
18
18
  s.email = 'yegor256@gmail.com'
19
19
  s.homepage = 'https://github.com/yegor256/rubocop-elegant'
@@ -21,4 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.rdoc_options = ['--charset=UTF-8']
22
22
  s.extra_rdoc_files = ['README.md']
23
23
  s.metadata['rubygems_mfa_required'] = 'true'
24
+ s.metadata['default_lint_roller_plugin'] = 'RuboCop::Elegant::Plugin'
25
+ s.add_dependency 'lint_roller', '~> 1.1'
26
+ s.add_dependency 'rubocop', '~> 1.75'
24
27
  end
metadata CHANGED
@@ -1,15 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-elegant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
- dependencies: []
12
- description: Explain it here...
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: lint_roller
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.1'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.1'
26
+ - !ruby/object:Gem::Dependency
27
+ name: rubocop
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.75'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.75'
40
+ description: 'RuboCop plugin enforcing elegant coding style: no comments (except SPDX
41
+ and magic), no empty lines in methods'
13
42
  email: yegor256@gmail.com
14
43
  executables: []
15
44
  extensions: []
@@ -35,6 +64,7 @@ licenses:
35
64
  - MIT
36
65
  metadata:
37
66
  rubygems_mfa_required: 'true'
67
+ default_lint_roller_plugin: RuboCop::Elegant::Plugin
38
68
  rdoc_options:
39
69
  - "--charset=UTF-8"
40
70
  require_paths: