matkoniecz-ruby-style 0.1.0 → 1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +1 -0
- data/Gemfile +3 -1
- data/README.md +11 -10
- data/matkoniecz-ruby-style.gemspec +4 -7
- data/reinstall.sh +11 -0
- data/reinstall_and_push_new_version.sh +4 -0
- data/standard_rubocop_config.yml +83 -3
- metadata +35 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 995eb438938e22dc49ec02f4db5628d087508a8eb3096b3d8f36f1d09624bdd1
|
4
|
+
data.tar.gz: c0e954c94476340b40e1bd66c0f9f98085059c9b05ba30f4b4d57cbce6673e18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2dd0b30f1423ae87a3be16ba36d08efc5b84c277802f2e3761fb627a25d9eccbd83142880e58cb69eb67efca05cf685d1c4576f3e1e900996f47d53b6939552
|
7
|
+
data.tar.gz: ab0507b5b2e102050a0b110204ddf3201e6a0697c2a4de4e0b18af0a384f2d66f2ab7ce0f954bcbbb0466f0195b1a65252e164e13262d9ef020a7576c7b59abe
|
data/.rubocop.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
inherit_from: standard_rubocop_config.yml
|
data/Gemfile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source "https://rubygems.org"
|
2
4
|
|
3
|
-
git_source(:github) {|repo_name| "https://github.com
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/matkoniecz/matkoniecz-ruby-style" }
|
4
6
|
|
5
7
|
# Specify your gem's dependencies in matkoniecz-ruby-style.gemspec
|
6
8
|
gemspec
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# matkoniecz-ruby-style
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Shared ruby style config for rubocop.
|
6
4
|
|
7
5
|
Inspired by [percy-style](https://github.com/percy/percy-style).
|
8
6
|
|
@@ -16,6 +14,12 @@ or add this line to your application's Gemfile:
|
|
16
14
|
gem 'matkoniecz-ruby-style'
|
17
15
|
```
|
18
16
|
|
17
|
+
or, for a Ruby library, add this to your gemspec:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
spec.add_development_dependency 'matkoniecz-ruby-style'
|
21
|
+
```
|
22
|
+
|
19
23
|
## Usage
|
20
24
|
|
21
25
|
Create a `.rubocop.yml` with the following directives:
|
@@ -26,14 +30,11 @@ inherit_gem:
|
|
26
30
|
- standard_rubocop_config.yml
|
27
31
|
```
|
28
32
|
|
33
|
+
You do not need to include rubocop directly in your application's dependencies. This gem includes a specific version of `rubocop` and `rubocop-rspec` that is shared across all projects.
|
34
|
+
|
29
35
|
## How to release new gem version
|
30
36
|
|
31
|
-
|
32
|
-
rm *.gem
|
33
|
-
gem build *.gemspec
|
34
|
-
gem install --user-install *.gem
|
35
|
-
gem push *.gem
|
36
|
-
```
|
37
|
+
See `reinstall.sh` and `reinstall_and_push_new_version.sh` files.
|
37
38
|
|
38
39
|
## Contributing
|
39
40
|
|
@@ -1,11 +1,6 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "matkoniecz/ruby/style/version"
|
5
|
-
|
6
1
|
Gem::Specification.new do |spec|
|
7
2
|
spec.name = "matkoniecz-ruby-style"
|
8
|
-
spec.version =
|
3
|
+
spec.version = 1.5
|
9
4
|
spec.authors = ["Mateusz Konieczny"]
|
10
5
|
spec.email = ["matkoniecz@gmail.com"]
|
11
6
|
|
@@ -15,10 +10,12 @@ Gem::Specification.new do |spec|
|
|
15
10
|
|
16
11
|
# Specify which files should be added to the gem when it is released.
|
17
12
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
18
|
-
spec.files = Dir.chdir(File.expand_path(
|
13
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
19
14
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
15
|
end
|
21
16
|
spec.bindir = "exe"
|
22
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
18
|
spec.require_paths = ["lib"]
|
19
|
+
spec.add_dependency "rubocop", "~> 0.89.1"
|
20
|
+
spec.add_dependency "rubocop-rspec", "~> 1.29.1"
|
24
21
|
end
|
data/reinstall.sh
ADDED
data/standard_rubocop_config.yml
CHANGED
@@ -1,5 +1,19 @@
|
|
1
|
+
require: rubocop-rspec
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
TargetRubyVersion: 2.7
|
5
|
+
NewCops: enable
|
6
|
+
|
7
|
+
# this hurts readability and makes code more confusing
|
8
|
+
# Rubocop is has opinion, Python has opinion, I also have opinion
|
9
|
+
# I would gladly enable MethodCallRequireArgsParentheses
|
10
|
+
Style/MethodCallWithoutArgsParentheses:
|
11
|
+
Enabled: false
|
12
|
+
|
1
13
|
# not preferred as this rule makes harder to move/add/remove items
|
2
|
-
Style/
|
14
|
+
Style/TrailingCommaInArrayLiteral:
|
15
|
+
Enabled: false
|
16
|
+
Style/TrailingCommaInHashLiteral:
|
3
17
|
Enabled: false
|
4
18
|
|
5
19
|
# change without benefit ( foobar == nil into foobar.nil?)
|
@@ -37,8 +51,74 @@ Lint/UnusedBlockArgument:
|
|
37
51
|
Style/SpecialGlobalVars:
|
38
52
|
Enabled: false
|
39
53
|
|
40
|
-
#
|
41
|
-
|
54
|
+
# there is no benefit from ugly code of collapsed form
|
55
|
+
Style/EmptyMethod:
|
56
|
+
EnforcedStyle: expanded
|
57
|
+
|
58
|
+
# unconvinced that it is useful
|
59
|
+
Style/RaiseArgs:
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
# adds useless line without benefit outweighting readability loss
|
63
|
+
Style/FrozenStringLiteralComment:
|
64
|
+
Enabled: false
|
65
|
+
|
66
|
+
# Ruby-specific syntax has no benefits whatsover over slashes
|
67
|
+
# if there is one let me know
|
68
|
+
Style/RegexpLiteral:
|
69
|
+
EnforcedStyle: slashes
|
70
|
+
|
71
|
+
# Standard array is much better and less overcomplicated
|
72
|
+
Style/SymbolArray:
|
73
|
+
EnforcedStyle: brackets
|
74
|
+
|
75
|
+
# Neither is much better, consistency is much more important
|
76
|
+
# for example see:
|
77
|
+
# group = ["#{fish[0]}", "#{fish[0]} filet", "filet z #{fish[1]}"]
|
78
|
+
# vs
|
79
|
+
# group = [(fish[0]).to_s, "#{fish[0]} filet", "filet z #{fish[1]}"]
|
80
|
+
Style/RedundantInterpolation:
|
81
|
+
Enabled: false
|
82
|
+
|
83
|
+
# local style optimization is better than global consistency
|
84
|
+
Style/StringLiteralsInInterpolation:
|
85
|
+
Enabled: false
|
86
|
+
|
87
|
+
# this rubyism is not more readable
|
88
|
+
Style/NumericPredicate:
|
89
|
+
Enabled: false
|
90
|
+
|
91
|
+
# this blank lines are neither helpful nor useful
|
92
|
+
Layout/EmptyLineAfterGuardClause:
|
93
|
+
Enabled: false
|
94
|
+
|
95
|
+
# not convinced that removing get_ is useful use of my time
|
96
|
+
Naming/AccessorMethodName:
|
97
|
+
Enabled: false
|
98
|
+
|
99
|
+
Naming/MethodParameterName:
|
100
|
+
AllowedNames:
|
101
|
+
- bb # standard shortening of "bounding box"
|
102
|
+
- r # standard shortening of "radius"
|
103
|
+
- mb # standard for megabytes
|
104
|
+
- x # typically perfectly fine for position to a plane
|
105
|
+
- "y" # typically perfectly fine for position to a plane
|
106
|
+
|
107
|
+
# avoding jumboXXLplus lines is a good idea, but
|
108
|
+
# there is no reason to stick to 80 characters
|
109
|
+
# a bit longer lines seems fine to me
|
110
|
+
Layout/LineLength:
|
111
|
+
Max: 88
|
112
|
+
|
113
|
+
# disabled due to bug reported as https://github.com/rubocop-hq/rubocop/issues/6630
|
114
|
+
# note that bug is likely to be closed but wontfixed
|
115
|
+
Style/CommentAnnotation:
|
116
|
+
Enabled: false
|
117
|
+
|
118
|
+
# benefits from adding ? to the method names are outweighted
|
119
|
+
# by increased costs of context switch between languages
|
120
|
+
Naming/PredicateName:
|
121
|
+
Enabled: false
|
42
122
|
|
43
123
|
# Uncomment following rules to allow using tabs:
|
44
124
|
#Layout/Tab:
|
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matkoniecz-ruby-style
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: '1.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mateusz Konieczny
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2020-08-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rubocop
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.89.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.89.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop-rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.29.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.29.1
|
13
41
|
description:
|
14
42
|
email:
|
15
43
|
- matkoniecz@gmail.com
|
@@ -18,11 +46,14 @@ extensions: []
|
|
18
46
|
extra_rdoc_files: []
|
19
47
|
files:
|
20
48
|
- ".gitignore"
|
49
|
+
- ".rubocop.yml"
|
21
50
|
- Gemfile
|
22
51
|
- LICENSE.txt
|
23
52
|
- README.md
|
24
53
|
- Rakefile
|
25
54
|
- matkoniecz-ruby-style.gemspec
|
55
|
+
- reinstall.sh
|
56
|
+
- reinstall_and_push_new_version.sh
|
26
57
|
- standard_rubocop_config.yml
|
27
58
|
homepage: https://github.com/matkoniecz/matkoniecz-ruby-style
|
28
59
|
licenses:
|
@@ -43,8 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
74
|
- !ruby/object:Gem::Version
|
44
75
|
version: '0'
|
45
76
|
requirements: []
|
46
|
-
|
47
|
-
rubygems_version: 2.6.14.1
|
77
|
+
rubygems_version: 3.1.2
|
48
78
|
signing_key:
|
49
79
|
specification_version: 4
|
50
80
|
summary: shared style config for Ruby
|