searchgov_style 0.1.17 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/.default.yml +160 -0
  3. data/LICENSE.md +31 -0
  4. data/README.md +96 -0
  5. metadata +10 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3a8e125846ebef6ad54bff284f4cc94aaa6a31cf3ad0ec6d5928108cad4f945
4
- data.tar.gz: 79450c70d44ebedf322d33db127bf157225f5c97261ac4f54856b6e61e2f66d1
3
+ metadata.gz: 66f30ad303cb1270373fd215915f341de228c5998ca8ee98efc9a0213cb1cae1
4
+ data.tar.gz: fbc60e8ff26f7ee4985670609ca6ea0840d6536191126d0a56ecb6395a84bb90
5
5
  SHA512:
6
- metadata.gz: fcc4b16f0055cc0196a6374c4866727d8700d6daf266090640a6faae4f7d2c93267588b0aba25eea60695e948f97703c9cc119033a99eb61f5be27b60ec43b35
7
- data.tar.gz: 9652ab2b4cc43bc723a9ea56623a62ddafe052f8d2f447aaa519f77d0a1b5d0106f0638f769c16ed1cd5c940a515e469d5c52f88e4f08c660baf97b398ea797e
6
+ metadata.gz: cd144e65555cf54bc699c5c00713af45a0cbe8f2ff7cf9523f398a5a1da0c2318d3a0b73649799bab4a3171d2669ede34bce9f2a235112330dea933a144c5fee
7
+ data.tar.gz: b66ffd027e78273473063e1e48a9547f9e2b62d1b67908f84edb702d553bf369a77dd16f09de5a4e367b0a321e563b172b76418c40456f3b2d42f8e9fa10469b
data/.default.yml ADDED
@@ -0,0 +1,160 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rails
4
+ - rubocop-rake
5
+ - rubocop-rspec
6
+
7
+ AllCops:
8
+ NewCops: enable
9
+ Exclude:
10
+ - 'bin/**/*'
11
+ - 'config/**/*'
12
+ - 'config.ru'
13
+ - 'db/**/*'
14
+ - 'vendor/**/*'
15
+
16
+ #### Bundler ####
17
+
18
+ Bundler/OrderedGems:
19
+ Enabled: false
20
+
21
+ #### Layout ####
22
+
23
+ Layout/DotPosition:
24
+ EnforcedStyle: trailing
25
+
26
+ Layout/ExtraSpacing:
27
+ AllowForAlignment: true
28
+
29
+ # We are disabling this cop to prevent analysis from tripping on the many pre-existing
30
+ # offenses in our repos. Devs can rely on themselves and each other to maintain
31
+ # sane line lengths going forward, and fix offending lines as needed.
32
+ Layout/LineLength:
33
+ Enabled: false
34
+
35
+ Layout/MultilineMethodCallIndentation:
36
+ EnforcedStyle: indented
37
+
38
+ #### Lint ####
39
+ Lint/AmbiguousBlockAssociation:
40
+ Exclude:
41
+ # https://github.com/rubocop/rubocop/issues/4222#issuecomment-290655562
42
+ - 'spec/**/*'
43
+
44
+ #### Metrics ####
45
+
46
+ Metrics/BlockLength:
47
+ CountComments: false # count full line comments?
48
+ Max: 25
49
+ IgnoredMethods:
50
+ # By default, exclude the `#refine` method, as it tends to have larger
51
+ # associated blocks.
52
+ - refine
53
+ Exclude:
54
+ # Specs by nature tend to have lengthy, nested blocks
55
+ - '*.gemspec'
56
+ - 'spec/**/*'
57
+
58
+ Metrics/MethodLength:
59
+ CountAsOne:
60
+ - array
61
+ - hash
62
+ - heredoc
63
+
64
+ #### Performance ####
65
+
66
+ Performance/TimesMap:
67
+ # Disabling. Using `Array.new` with a block is marginally more performant, but
68
+ # `n.times.map` is much more readable. The former can be used when n is large.
69
+ # https://stackoverflow.com/questions/41518896/why-does-rubocop-suggest-replacing-times-map-with-array-new
70
+ Enabled: false
71
+
72
+ #### Rails ####
73
+
74
+ Rails/SkipsModelValidations:
75
+ # We are leaving this cop enabled as a warning.
76
+ # Failures can be approved as needed during code review.
77
+ Enabled: true
78
+
79
+ #### RSpec ####
80
+
81
+ # See also the list of RSpec statements that we exempt from the block
82
+ # length cop, under Metrics/BlockLength above
83
+
84
+ RSpec/DescribeClass:
85
+ Exclude:
86
+ - 'spec/lib/tasks/**/*'
87
+
88
+ RSpec/DescribedClass:
89
+ SkipBlocks: true
90
+
91
+ RSpec/ExampleLength:
92
+ Enabled: false
93
+
94
+ RSpec/ExpectChange:
95
+ EnforcedStyle: block
96
+
97
+ RSpec/ImplicitSubject:
98
+ EnforcedStyle: single_statement_only
99
+
100
+ RSpec/MessageChain:
101
+ Enabled: false
102
+
103
+ RSpec/MultipleExpectations:
104
+ Enabled: false
105
+
106
+ RSpec/MultipleMemoizedHelpers:
107
+ Enabled: false
108
+
109
+ RSpec/NestedGroups:
110
+ Enabled: false
111
+
112
+ #### Style ####
113
+
114
+ Style/Documentation:
115
+ Enabled: false
116
+
117
+ Style/IfUnlessModifier:
118
+ Enabled: false
119
+
120
+ Style/MethodCallWithArgsParentheses:
121
+ Description: 'Use parentheses for method calls with arguments.'
122
+ Enabled: true
123
+ IgnoredMethods:
124
+ # Ignore Ruby keyword methods:
125
+ # https://rubystyle.guide/#methods-that-have-keyword-status-in-ruby
126
+ - require
127
+ - yield
128
+ # https://rubystyle.guide/#exceptions
129
+ - raise
130
+ # Ignore logging methods, as they are considered part of an internal DSL
131
+ # https://rubystyle.guide/#methods-that-are-part-of-an-internal-dsl
132
+ - debug
133
+ - info
134
+ - warn
135
+ - error
136
+ - fatal
137
+ # Ignore Rails DSL methods
138
+ - has_many
139
+ - has_one
140
+ - order
141
+ - redirect_to
142
+ - render
143
+ - reset_callbacks
144
+ - set_callback
145
+ - skip_callback
146
+ Exclude:
147
+ - 'spec/**/*'
148
+ - 'Gemfile'
149
+ - 'db/**/*'
150
+ - '*.gemspec'
151
+
152
+ Style/MixinUsage:
153
+ Exclude:
154
+ - bin/*
155
+
156
+ Style/RescueStandardError:
157
+ Enabled: false
158
+
159
+ Style/SymbolArray:
160
+ MinSize: 4
data/LICENSE.md ADDED
@@ -0,0 +1,31 @@
1
+ As a work of the United States government, this project is in the
2
+ public domain within the United States.
3
+
4
+ Additionally, we waive copyright and related rights in the work
5
+ worldwide through the CC0 1.0 Universal public domain dedication.
6
+
7
+ ## CC0 1.0 Universal summary
8
+
9
+ This is a human-readable summary of the [Legal Code (read the full text)](https://creativecommons.org/publicdomain/zero/1.0/legalcode).
10
+
11
+ ### No copyright
12
+
13
+ The person who associated a work with this deed has dedicated the work to
14
+ the public domain by waiving all rights to the work worldwide
15
+ under copyright law, including all related and neighboring rights, to the
16
+ extent allowed by law.
17
+
18
+ You can copy, modify, distribute and perform the work, even for commercial
19
+ purposes, all without asking permission.
20
+
21
+ ### Other information
22
+
23
+ In no way are the patent or trademark rights of any person affected by CC0,
24
+ nor are the rights that other persons may have in the work or in how the
25
+ work is used, such as publicity or privacy rights.
26
+
27
+ Unless expressly stated otherwise, the person who associated a work with
28
+ this deed makes no warranties about the work, and disclaims liability for
29
+ all uses of the work, to the fullest extent permitted by applicable law.
30
+ When using or citing the work, you should not imply endorsement by the
31
+ author or the affirmer.
data/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # searchgov_style
2
+
3
+ Shared [Rubocop](https://rubocop.org/) configuration for Search.gov repositories
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ group :test, :development do
11
+ gem 'searchgov_style'
12
+ end
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install searchgov_style
22
+
23
+ In the root directory of the repo using this gem, create a `.rubocop.yml` with the following directives:
24
+
25
+ ### For repositories that use Code Climate:
26
+
27
+ Refer to the [work around](https://github.com/codeclimate/codeclimate-rubocop/issues/71#issuecomment-635055223) for Code Climate's inability to use Rubocop's inherit_gem directive.
28
+
29
+ ```yaml
30
+ inherit_from:
31
+ - https://raw.githubusercontent.com/GSA/searchgov_style/main/.default.yml
32
+ ```
33
+
34
+ ### For repositories that do not use Code Climate:
35
+
36
+ ```yaml
37
+ inherit_gem:
38
+ searchgov_style:
39
+ - .default.yml
40
+ ```
41
+
42
+ * Generate a `.rubocop_todo.yml`:
43
+
44
+ rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 2000
45
+
46
+ * Add the following entry to `.gitignore`:
47
+
48
+ .rubocop*default-yml
49
+
50
+ ## Usage
51
+
52
+ Run:
53
+
54
+ ```bash
55
+ $ bundle exec rubocop
56
+ ```
57
+
58
+ You do not need to include rubocop directly in your application's dependencies. searchgov_style will include specific versions of `rubocop` and related gems (such as `rubocop-rspec`) that are shared across all projects.
59
+
60
+ Refer to the [Rubocop documentation](https://docs.rubocop.org/) for Rubocop usage instructions.
61
+
62
+ ## Development
63
+
64
+ Install the development gems:
65
+
66
+ $ bundle
67
+
68
+ Run Rubocop on the gem repository itself:
69
+
70
+ $ rubocop
71
+
72
+ ### Upgrading Rubocop
73
+
74
+ To upgrade the version of Rubocop used by this gem, perform the
75
+ following steps to ensure [compatibility with CodeClimate](https://docs.codeclimate.com/docs/rubocop#using-rubocops-newer-versions):
76
+
77
+ 1. Verify that the new version is supported by CodeClimate:
78
+ [list of Rubocop channels for CodeClimate](https://github.com/codeclimate/codeclimate-rubocop/branches/all?utf8=%E2%9C%93&query=channel%2Frubocop)
79
+ 1. Verify that the new version is listed as a channel for the Rubocop engine for the CodeClimate CLI:
80
+ [CodeClimate Engines](https://github.com/codeclimate/codeclimate/blob/master/config/engines.yml)
81
+ 1. Bump the version of Rubocop in the [gemspec](searchgov-style.gemspec)
82
+ 1. Bump the Rubocop channel in [.codeclimate.yml](.codeclimate.yml)
83
+
84
+ Verify your configuration and compatibility locally using the [CodeClimate CLI](https://github.com/codeclimate/codeclimate):
85
+
86
+ $ bundle update
87
+ $ codeclimate validate-config
88
+ $ codeclimate analyze lib/ -e rubocop
89
+
90
+ ## Contributing
91
+
92
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/searchgov_style.
93
+
94
+ ## License
95
+
96
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchgov_style
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - MothOnMars
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-31 00:00:00.000000000 Z
11
+ date: 2022-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.23.0
47
+ version: 1.31.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 1.23.0
54
+ version: 1.31.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubocop-performance
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,10 @@ email:
114
114
  executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
- files: []
117
+ files:
118
+ - ".default.yml"
119
+ - LICENSE.md
120
+ - README.md
118
121
  homepage: https://github.com/GSA/searchgov_style
119
122
  licenses:
120
123
  - MIT
@@ -130,14 +133,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
130
133
  requirements:
131
134
  - - ">="
132
135
  - !ruby/object:Gem::Version
133
- version: 2.5.0
136
+ version: 2.6.0
134
137
  required_rubygems_version: !ruby/object:Gem::Requirement
135
138
  requirements:
136
139
  - - ">="
137
140
  - !ruby/object:Gem::Version
138
141
  version: '0'
139
142
  requirements: []
140
- rubygems_version: 3.1.6
143
+ rubygems_version: 3.3.15
141
144
  signing_key:
142
145
  specification_version: 4
143
146
  summary: Shared Rubocop configuration for Search.gov repositories