punchlist 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +132 -0
- data/.envrc +4 -0
- data/.git-hooks/pre_commit/circle_ci.rb +25 -0
- data/.git-hooks/pre_commit/punchlist.rb +51 -0
- data/.git-hooks/pre_commit/solargraph_typecheck.rb +64 -0
- data/.gitattributes +6 -0
- data/.gitignore +60 -0
- data/.markdownlint_style.rb +3 -0
- data/.mdlrc +1 -0
- data/.overcommit.yml +87 -0
- data/.pronto.yml +2 -0
- data/.rubocop.yml +148 -0
- data/.solargraph.yml +26 -0
- data/.yamllint.yml +8 -0
- data/CODE_OF_CONDUCT.md +133 -0
- data/CONTRIBUTING.rst +75 -0
- data/ChangeLog.md +8 -0
- data/DEVELOPMENT.md +31 -0
- data/Gemfile +26 -0
- data/Gemfile.lock +186 -0
- data/LICENSE +22 -0
- data/Makefile +104 -0
- data/README.md +27 -0
- data/Rakefile +2 -49
- data/bin/bump +29 -0
- data/bin/overcommit +29 -0
- data/bin/rake +29 -0
- data/bin/rubocop +27 -0
- data/bin/solargraph +27 -0
- data/bin/yard +27 -0
- data/config/env.1p +0 -0
- data/docs/.gitignore +3 -0
- data/docs/cookiecutter_input.json +16 -0
- data/feature/expected/mixed_types_of_source_files_results.txt +2 -0
- data/feature/expected/no_files_results.txt +0 -0
- data/feature/expected/non_source_file_with_pis_results.txt +0 -0
- data/feature/expected/one_source_file_with_cis_results.txt +1 -0
- data/feature/expected/scala_file_to_be_ignored_results.txt +1 -0
- data/feature/expected/source_file_with_no_items_results.txt +0 -0
- data/feature/feature_helper.rb +41 -0
- data/feature/pronto_punchlist_use_spec.rb +26 -0
- data/feature/punchlist_cli_spec.rb +63 -0
- data/feature/samples/mixed_types_of_source_files/lib/bar.scala +1 -0
- data/feature/samples/mixed_types_of_source_files/lib/foo.rb +4 -0
- data/feature/samples/no_files/.ignore +0 -0
- data/feature/samples/non_source_file_with_pis/foo.doc +5 -0
- data/feature/samples/one_source_file_with_cis/app/foo.rb +4 -0
- data/feature/samples/scala_file_to_be_ignored/lib/bar.scala +1 -0
- data/feature/samples/scala_file_to_be_ignored/lib/foo.rb +4 -0
- data/feature/samples/source_file_with_no_items/foo.rb +3 -0
- data/fix.sh +411 -0
- data/lib/punchlist/inspector.rb +27 -7
- data/lib/punchlist/version.rb +1 -1
- data/lib/punchlist.rb +1 -0
- data/metrics/brakeman_high_water_mark +1 -0
- data/metrics/flake8_high_water_mark +1 -0
- data/metrics/jscs_high_water_mark +1 -0
- data/metrics/punchlist_high_water_mark +1 -0
- data/metrics/pycodestyle_high_water_mark +1 -0
- data/metrics/rails_best_practices_high_water_mark +1 -0
- data/metrics/scalastyle_high_water_mark +1 -0
- data/metrics/shellcheck_high_water_mark +1 -0
- data/package.json +9 -0
- data/punchlist.gemspec +25 -31
- data/rakelib/citest.rake +4 -0
- data/rakelib/clear_metrics.rake +9 -0
- data/rakelib/console.rake +6 -0
- data/rakelib/default.rake +4 -0
- data/rakelib/doc.rake +6 -0
- data/rakelib/feature.rake +10 -0
- data/rakelib/gem_tasks.rake +3 -0
- data/rakelib/localtest.rake +4 -0
- data/rakelib/overcommit.rake +6 -0
- data/rakelib/quality.rake +4 -0
- data/rakelib/repl.rake +4 -0
- data/rakelib/spec.rake +9 -0
- data/rakelib/undercover.rake +8 -0
- data/requirements_dev.txt +2 -0
- metadata +88 -115
- data/License.txt +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e8aef2fe3d82b4fe162b643b0898f74e800ea607d806e6ce58bf45d0a3fd1e21
|
4
|
+
data.tar.gz: 73264d34929b8ad1fb6dd92dacaa131d7a0d6b9d71256fc901ab98f2f58f1450
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bddf9817bcb9f4512397e2da5ee97269555e3eece6d260abd5df791436012841d33a9b9c836ac369b4dc16c411e20bd646a0fe250467a7ae0d744b6962a47ce9
|
7
|
+
data.tar.gz: a7f3c332d1d4a701fb6cc9a416d20ec5d68ce8c1b6369602a9420f8fc52432ebd1586c3c5b215799d4f0badabaa514cb91d93df11b8b2f2b99c5fbc6a11efb1f
|
@@ -0,0 +1,132 @@
|
|
1
|
+
---
|
2
|
+
version: 2.1
|
3
|
+
|
4
|
+
commands:
|
5
|
+
run_with_languages:
|
6
|
+
description: "Run the given command in an environment that includes relevant langauges in the PATH"
|
7
|
+
parameters:
|
8
|
+
command:
|
9
|
+
type: string
|
10
|
+
description: "What command to execute"
|
11
|
+
label:
|
12
|
+
type: string
|
13
|
+
description: "What to label the run"
|
14
|
+
default: <<parameters.command>>
|
15
|
+
steps:
|
16
|
+
- run:
|
17
|
+
name: <<parameters.label>>
|
18
|
+
command: |
|
19
|
+
export PATH="${HOME}/.pyenv/bin:${PATH}"
|
20
|
+
export PATH="${HOME}/.rbenv/bin:${HOME}/.rbenv/shims:${PATH}"
|
21
|
+
export PATH="${HOME}/project/node_modules/.bin:${PATH}"
|
22
|
+
eval "$(pyenv init --path)"
|
23
|
+
eval "$(pyenv virtualenv-init -)"
|
24
|
+
eval "$(rbenv init -)"
|
25
|
+
export BUNDLE_PATH=vendor/bundle
|
26
|
+
|
27
|
+
<<parameters.command>>
|
28
|
+
environment:
|
29
|
+
# https://app.circleci.com/pipelines/github/apiology/cookiecutter-pypackage/4/workflows/29074dc8-944c-4600-8aaa-5116575fed90/jobs/4
|
30
|
+
"LC_ALL": "C.UTF-8"
|
31
|
+
"LANG": "C.UTF-8"
|
32
|
+
set_up_environment:
|
33
|
+
description: "Install source environment"
|
34
|
+
steps:
|
35
|
+
- checkout
|
36
|
+
- run: |
|
37
|
+
sed -E -e 's/punchlist \([[:digit:]]+.[[:digit:]]+.[[:digit:]]+\)/punchlist (0.1.0)/g' \
|
38
|
+
Gemfile.lock > Gemfile.lock.deversioned
|
39
|
+
- restore_cache:
|
40
|
+
key: gems-v2-{{ checksum "Gemfile.lock.deversioned" }}
|
41
|
+
- restore_cache:
|
42
|
+
key: wheels-v1-3.12.1-{{ checksum "requirements_dev.txt" }}
|
43
|
+
- run:
|
44
|
+
name: Initialize packages
|
45
|
+
command: |
|
46
|
+
export BUNDLE_PATH=vendor/bundle
|
47
|
+
'./fix.sh'
|
48
|
+
- run:
|
49
|
+
name: Verify Gemfile.lock
|
50
|
+
command: |
|
51
|
+
if ! git diff --exit-code Gemfile.lock
|
52
|
+
then
|
53
|
+
>&2 echo "Please resolve changes to Gemfile.lock after bundle install to avoid caching difficulties"
|
54
|
+
exit 1
|
55
|
+
fi
|
56
|
+
- save_cache:
|
57
|
+
key: gems-v2-{{ checksum "Gemfile.lock.deversioned" }}
|
58
|
+
paths:
|
59
|
+
- "vendor/bundle"
|
60
|
+
- save_cache:
|
61
|
+
key: wheels-v1-3.12.1-{{ checksum "requirements_dev.txt" }}
|
62
|
+
paths:
|
63
|
+
- "/home/circleci/.cache/pip/wheels"
|
64
|
+
- "/home/circleci/.pyenv/versions/3.12.1/envs/punchlist-3.12.1"
|
65
|
+
- "/home/circleci/.pyenv/versions/punchlist-3.12.1"
|
66
|
+
- run:
|
67
|
+
name: Download new circleci tool
|
68
|
+
command: |
|
69
|
+
curl -fLSs \
|
70
|
+
https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | sudo bash
|
71
|
+
overcommit:
|
72
|
+
description: "Run overcommit"
|
73
|
+
steps:
|
74
|
+
- set_up_environment
|
75
|
+
- run_with_languages:
|
76
|
+
label: Run overcommit
|
77
|
+
command: |
|
78
|
+
# Coax overcommit into working
|
79
|
+
git config --global user.email "test@test.test"
|
80
|
+
git config --global user.name "Test Test"
|
81
|
+
bundle exec overcommit --sign
|
82
|
+
bundle exec overcommit --sign pre-commit
|
83
|
+
|
84
|
+
bundle exec overcommit --run
|
85
|
+
|
86
|
+
jobs:
|
87
|
+
overcommit:
|
88
|
+
working_directory: ~/punchlist
|
89
|
+
docker:
|
90
|
+
- image: apiology/circleci-ruby:latest
|
91
|
+
steps:
|
92
|
+
- when:
|
93
|
+
condition:
|
94
|
+
equal: [<< pipeline.git.branch >>, "main"]
|
95
|
+
steps:
|
96
|
+
- overcommit
|
97
|
+
- unless:
|
98
|
+
condition:
|
99
|
+
equal: [<< pipeline.git.branch >>, "main"]
|
100
|
+
steps:
|
101
|
+
- run: echo "overcommit only runs on main branch"
|
102
|
+
build:
|
103
|
+
working_directory: ~/punchlist
|
104
|
+
docker:
|
105
|
+
- image: apiology/circleci-ruby:latest
|
106
|
+
steps:
|
107
|
+
- set_up_environment
|
108
|
+
- run_with_languages:
|
109
|
+
label: test
|
110
|
+
command: make citest cicoverage
|
111
|
+
# This seemed to shave 5ish% of the build time off when added
|
112
|
+
resource_class: large
|
113
|
+
|
114
|
+
workflows:
|
115
|
+
version: 2
|
116
|
+
weekly:
|
117
|
+
triggers:
|
118
|
+
- schedule:
|
119
|
+
cron: "0 0 * * 6"
|
120
|
+
filters:
|
121
|
+
branches:
|
122
|
+
only:
|
123
|
+
- main
|
124
|
+
jobs:
|
125
|
+
- build
|
126
|
+
- overcommit
|
127
|
+
overcommit:
|
128
|
+
jobs:
|
129
|
+
- overcommit
|
130
|
+
build:
|
131
|
+
jobs:
|
132
|
+
- build
|
data/.envrc
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'overcommit'
|
4
|
+
require 'overcommit/hook/pre_commit/base'
|
5
|
+
|
6
|
+
module Overcommit
|
7
|
+
module Hook
|
8
|
+
module PreCommit
|
9
|
+
# CircleCI plugin for Overcommit to validate config file (.circleci/config.yml)
|
10
|
+
class CircleCi < Base
|
11
|
+
# @return [Symbol, Array<[Symbol, String]>]
|
12
|
+
def run
|
13
|
+
result = execute(command)
|
14
|
+
return :pass if result.success?
|
15
|
+
|
16
|
+
if result.success?
|
17
|
+
:pass
|
18
|
+
else
|
19
|
+
[:fail, result.stderr]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'overcommit'
|
4
|
+
require 'overcommit/hook/pre_commit/base'
|
5
|
+
|
6
|
+
# Overcommit configuration
|
7
|
+
module Overcommit
|
8
|
+
module Hook
|
9
|
+
module PreCommit
|
10
|
+
# Runs `punchlist` against any modified Ruby files.
|
11
|
+
class Punchlist < Base
|
12
|
+
# @param stdout [String]
|
13
|
+
# @return [Array<Overcommit::Hook::Message>]
|
14
|
+
def parse_output(stdout)
|
15
|
+
stdout.split("\n").map do |line|
|
16
|
+
# @sg-ignore
|
17
|
+
file, line_no, _message = line.split(':', 3)
|
18
|
+
Overcommit::Hook::Message.new(:error, file, line_no.to_i, line)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [String]
|
23
|
+
def files_glob
|
24
|
+
"{" \
|
25
|
+
"#{applicable_files.join(',')}" \
|
26
|
+
"}"
|
27
|
+
end
|
28
|
+
|
29
|
+
# @return [Symbol, Array<Overcommit::Hook::Message>]
|
30
|
+
def run
|
31
|
+
# @sg-ignore
|
32
|
+
# @type [Overcommit::Subprocess::Result]
|
33
|
+
result = execute([*command, '-g', files_glob])
|
34
|
+
|
35
|
+
warn result.stderr
|
36
|
+
|
37
|
+
# If the command exited with a non-zero status or produced any output, treat it as a failure
|
38
|
+
if result.status.nonzero? || !result.stdout.empty? || !result.stderr.empty?
|
39
|
+
# Parse the output to create Message objects
|
40
|
+
stdout = result.stdout
|
41
|
+
messages = parse_output(stdout)
|
42
|
+
|
43
|
+
return messages
|
44
|
+
end
|
45
|
+
|
46
|
+
:pass
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'overcommit'
|
4
|
+
require 'overcommit/hook/pre_commit/base'
|
5
|
+
|
6
|
+
# @!override Overcommit::Hook::Base#execute
|
7
|
+
# @return [Overcommit::Subprocess::Result]
|
8
|
+
|
9
|
+
module Overcommit
|
10
|
+
module Hook
|
11
|
+
module PreCommit
|
12
|
+
# Runs `solargraph typecheck` against any modified Ruby files.
|
13
|
+
class SolargraphTypecheck < Base
|
14
|
+
# @return [Array<String>]
|
15
|
+
def run
|
16
|
+
errors = []
|
17
|
+
|
18
|
+
applicable_files.each do |file|
|
19
|
+
generate_errors_for_file(file, errors)
|
20
|
+
end
|
21
|
+
|
22
|
+
# output message to stderr
|
23
|
+
errors
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
# @param file [String]
|
29
|
+
# @param errors [Array<String>]
|
30
|
+
# @return [void]
|
31
|
+
def generate_errors_for_file(file, errors)
|
32
|
+
result = execute(['bundle', 'exec', 'solargraph', 'typecheck', '--level', 'strong', file])
|
33
|
+
return if result.success?
|
34
|
+
|
35
|
+
# @type [String]
|
36
|
+
stdout = result.stdout
|
37
|
+
|
38
|
+
stdout.split("\n").each do |error|
|
39
|
+
error = parse_error(file, error)
|
40
|
+
errors << error unless error.nil?
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# @param file [String]
|
45
|
+
# @param error [String]
|
46
|
+
# @return [Overcommit::Hook::Message, nil]
|
47
|
+
def parse_error(file, error)
|
48
|
+
# Parse the result for the line number # @type [MatchData]
|
49
|
+
match = error.match(/^(.+?):(\d+)/)
|
50
|
+
return nil unless match
|
51
|
+
|
52
|
+
# @!override MatchData.captures
|
53
|
+
# @return [Array]
|
54
|
+
# @sg-ignore
|
55
|
+
file_path, lineno = match.captures
|
56
|
+
message = error.sub("#{file_path}:#{lineno} - ",
|
57
|
+
"#{file_path}:#{lineno}: ")
|
58
|
+
# Emit the errors in the specified format
|
59
|
+
Overcommit::Hook::Message.new(:error, file, lineno.to_i, message)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
data/.gitattributes
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
# there's a lot of .sh in the build machinery; this can overwhelm
|
2
|
+
# smaller projects and confuse GitHub's detection of majority project
|
3
|
+
# type (GitHub uses the linguist library)
|
4
|
+
#
|
5
|
+
# https://dev.to/katkelly/changing-your-repo-s-language-in-github-5gjo
|
6
|
+
*.sh linguist-detectable=false
|
data/.gitignore
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# OSX useful to ignore
|
2
|
+
*.DS_Store
|
3
|
+
.AppleDouble
|
4
|
+
.LSOverride
|
5
|
+
|
6
|
+
# Thumbnails
|
7
|
+
._*
|
8
|
+
|
9
|
+
# Files that might appear in the root of a volume
|
10
|
+
.DocumentRevisions-V100
|
11
|
+
.fseventsd
|
12
|
+
.Spotlight-V100
|
13
|
+
.TemporaryItems
|
14
|
+
.Trashes
|
15
|
+
.VolumeIcon.icns
|
16
|
+
.com.apple.timemachine.donotpresent
|
17
|
+
|
18
|
+
# Directories potentially created on remote AFP share
|
19
|
+
.AppleDB
|
20
|
+
.AppleDesktop
|
21
|
+
Network Trash Folder
|
22
|
+
Temporary Items
|
23
|
+
.apdisk
|
24
|
+
|
25
|
+
# IntelliJ Idea family of suites
|
26
|
+
.idea
|
27
|
+
*.iml
|
28
|
+
## File-based project format:
|
29
|
+
*.ipr
|
30
|
+
*.iws
|
31
|
+
## mpeltonen/sbt-idea plugin
|
32
|
+
.idea_modules/
|
33
|
+
|
34
|
+
# IDE settings
|
35
|
+
.vscode/
|
36
|
+
|
37
|
+
# Editor temp files
|
38
|
+
*~
|
39
|
+
\#*\#
|
40
|
+
|
41
|
+
# Used by Makefile to track what we have and haven't installed
|
42
|
+
Gemfile.lock.installed
|
43
|
+
requirements_dev.txt.installed
|
44
|
+
|
45
|
+
# Used by CircleCI as a place to store installed gems
|
46
|
+
/vendor
|
47
|
+
|
48
|
+
# Installed by fix.sh based on what latest versions are
|
49
|
+
/.python-version
|
50
|
+
/.ruby-version
|
51
|
+
|
52
|
+
# Ruby-related
|
53
|
+
/.bundle/
|
54
|
+
/.yardoc
|
55
|
+
/_yardoc/
|
56
|
+
/doc/
|
57
|
+
/pkg/
|
58
|
+
/spec/reports/
|
59
|
+
/tmp/
|
60
|
+
/coverage/
|
data/.mdlrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
style ".markdownlint_style.rb"
|
data/.overcommit.yml
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
---
|
2
|
+
# Use this file to configure the Overcommit hooks you wish to use. This will
|
3
|
+
# extend the default configuration defined in:
|
4
|
+
# https://github.com/sds/overcommit/blob/master/config/default.yml
|
5
|
+
#
|
6
|
+
# At the topmost level of this YAML file is a key representing type of hook
|
7
|
+
# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
|
8
|
+
# customize each hook, such as whether to only run it on certain files (via
|
9
|
+
# `include`), whether to only display output if it fails (via `quiet`), etc.
|
10
|
+
#
|
11
|
+
# For a complete list of hooks, see:
|
12
|
+
# https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
|
13
|
+
#
|
14
|
+
# For a complete list of options that you can use to customize hooks, see:
|
15
|
+
# https://github.com/sds/overcommit#configuration
|
16
|
+
#
|
17
|
+
# Uncomment the following lines to make the configuration take effect.
|
18
|
+
|
19
|
+
PreCommit:
|
20
|
+
# Extend default config at
|
21
|
+
# https://github.com/sds/overcommit/blob/master/config/default.yml
|
22
|
+
BrokenSymlinks:
|
23
|
+
enabled: true
|
24
|
+
description: 'Check for broken symlinks'
|
25
|
+
quiet: true
|
26
|
+
RuboCop:
|
27
|
+
enabled: true
|
28
|
+
command: ['bundle', 'exec', 'rubocop']
|
29
|
+
include:
|
30
|
+
- '**/*.gemspec'
|
31
|
+
- '**/*.rake'
|
32
|
+
- '**/*.rb'
|
33
|
+
- '**/*.ru'
|
34
|
+
- '**/Gemfile'
|
35
|
+
- '**/Rakefile'
|
36
|
+
- 'bin/*'
|
37
|
+
- 'exe/*'
|
38
|
+
problem_on_unmodified_line: warn
|
39
|
+
exclude:
|
40
|
+
- db/migrate/*.rb
|
41
|
+
- db/schema.rb
|
42
|
+
PythonFlake8:
|
43
|
+
enabled: true
|
44
|
+
on_warn: fail
|
45
|
+
ShellCheck:
|
46
|
+
enabled: true
|
47
|
+
on_warn: fail
|
48
|
+
include:
|
49
|
+
- '.envrc'
|
50
|
+
- '**/*.sh'
|
51
|
+
YamlLint:
|
52
|
+
enabled: true
|
53
|
+
flags: ['-c', '.yamllint.yml', '--format=parsable', '--strict']
|
54
|
+
on_warn: fail
|
55
|
+
CircleCi:
|
56
|
+
required_executable: 'circleci'
|
57
|
+
flags: ['config', 'validate']
|
58
|
+
include:
|
59
|
+
- '.circleci/config.yml'
|
60
|
+
enabled: true
|
61
|
+
SolargraphTypecheck:
|
62
|
+
enabled: true
|
63
|
+
problem_on_unmodified_line: warn
|
64
|
+
include:
|
65
|
+
- '**/*.rb'
|
66
|
+
Punchlist:
|
67
|
+
command: ['bundle', 'exec', 'punchlist']
|
68
|
+
enabled: true
|
69
|
+
problem_on_unmodified_line: warn
|
70
|
+
|
71
|
+
PrePush:
|
72
|
+
RakeTarget:
|
73
|
+
enabled: true
|
74
|
+
command: ['bundle', 'exec', 'rake']
|
75
|
+
include:
|
76
|
+
- 'Rakefile'
|
77
|
+
targets:
|
78
|
+
- 'clear_metrics'
|
79
|
+
- 'spec'
|
80
|
+
- 'undercover'
|
81
|
+
|
82
|
+
#PostCheckout:
|
83
|
+
# ALL: # Special hook name that customizes all hooks of this type
|
84
|
+
# quiet: true # Change all post-checkout hooks to only display output on failure
|
85
|
+
#
|
86
|
+
# IndexTags:
|
87
|
+
# enabled: true # Generate a tags file with `ctags` each time HEAD changes
|
data/.pronto.yml
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
---
|
2
|
+
Layout/LineLength:
|
3
|
+
Max: 120
|
4
|
+
|
5
|
+
Layout/MultilineMethodCallIndentation:
|
6
|
+
EnforcedStyle: indented
|
7
|
+
|
8
|
+
Lint/EmptyClass:
|
9
|
+
# some workarounds for circular dependencies require empty classes
|
10
|
+
AllowComments: true
|
11
|
+
|
12
|
+
# conflicts with solargraph wanting every parameter documented with
|
13
|
+
# actual name and subclassing
|
14
|
+
Lint/UnusedMethodArgument:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
# https://stackoverflow.com/questions/40934345/rubocop-25-line-block-size-and-rspec-tests
|
18
|
+
Metrics/BlockLength:
|
19
|
+
# Exclude DSLs
|
20
|
+
Exclude:
|
21
|
+
- 'Rakefile'
|
22
|
+
- '*.gemspec'
|
23
|
+
- '**/*.rake'
|
24
|
+
- 'spec/**/*.rb'
|
25
|
+
- 'feature/**/*.rb'
|
26
|
+
|
27
|
+
# I use keyword arguments for a poor man's dependency injection to cut
|
28
|
+
# down on the magic in my tests.
|
29
|
+
Metrics/ParameterLists:
|
30
|
+
CountKeywordArgs: false
|
31
|
+
|
32
|
+
Naming/HeredocDelimiterNaming:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
Naming/MethodParameterName:
|
36
|
+
Enabled: true
|
37
|
+
AllowedNames:
|
38
|
+
# I don't think things on this list are a terribly hard convention
|
39
|
+
# for folks to learn. bbatsov also doesn't care much for this
|
40
|
+
# check:
|
41
|
+
#
|
42
|
+
# https://github.com/rubocop-hq/rubocop/issues/3666
|
43
|
+
- e # exception
|
44
|
+
- x # cartesian coordinates
|
45
|
+
- y # cartesian coordinates
|
46
|
+
|
47
|
+
# by default (EnforcedStyle=NormalCase) this rule doesn't like
|
48
|
+
# things like check_1, check_2, etc and wants check1, check2, etc. I
|
49
|
+
# like the former.
|
50
|
+
#
|
51
|
+
# https://docs.rubocop.org/rubocop/cops_naming.html#namingvariablenumber
|
52
|
+
Naming/VariableNumber:
|
53
|
+
Enabled: true
|
54
|
+
EnforcedStyle: snake_case
|
55
|
+
|
56
|
+
# http://www.betterspecs.org/#single
|
57
|
+
#
|
58
|
+
# > in tests that are not isolated (e.g. ones that integrate with a
|
59
|
+
# > DB, an external webservice, or end-to-end-tests), you take a
|
60
|
+
# > massive performance hit to do the same setup over and over again,
|
61
|
+
# > just to set a different expectation in each test. In these sorts
|
62
|
+
# > of slower tests, I think it's fine to specify more than one
|
63
|
+
# > isolated behavior.
|
64
|
+
RSpec/MultipleExpectations:
|
65
|
+
Exclude:
|
66
|
+
- 'feature/**/*.rb'
|
67
|
+
|
68
|
+
# Bump this up a bit for now. I find useful, readable specs at level
|
69
|
+
# 4, for now at least.
|
70
|
+
#
|
71
|
+
# The logic here makes sense to me:
|
72
|
+
# https://github.com/datarockets/ruby-style/issues/36
|
73
|
+
RSpec/NestedGroups:
|
74
|
+
Max: 4
|
75
|
+
|
76
|
+
# Likewise
|
77
|
+
RSpec/MultipleMemoizedHelpers:
|
78
|
+
Max: 8
|
79
|
+
|
80
|
+
# Ensure we reference constants on classes in instance_double() so
|
81
|
+
# that a renamed class is caught and doubles are always actually
|
82
|
+
# verified.
|
83
|
+
RSpec/VerifiedDoubleReference:
|
84
|
+
Enabled: true
|
85
|
+
EnforcedStyle: constant
|
86
|
+
|
87
|
+
#
|
88
|
+
# Add 'XX X' to the standard list
|
89
|
+
#
|
90
|
+
Style/CommentAnnotation:
|
91
|
+
Keywords:
|
92
|
+
- "TOD\
|
93
|
+
O"
|
94
|
+
- "FIXM\
|
95
|
+
E"
|
96
|
+
- "OPTIMIZ\
|
97
|
+
E"
|
98
|
+
- "HAC\
|
99
|
+
K"
|
100
|
+
- "REVIE\
|
101
|
+
W"
|
102
|
+
- "XX\
|
103
|
+
X"
|
104
|
+
|
105
|
+
Style/DocumentationMethod:
|
106
|
+
Enabled: true
|
107
|
+
Include:
|
108
|
+
- 'lib/punchlist/*.rb'
|
109
|
+
|
110
|
+
Style/StringLiterals:
|
111
|
+
EnforcedStyle: single_quotes
|
112
|
+
SupportedStyles:
|
113
|
+
- single_quotes
|
114
|
+
- double_quotes
|
115
|
+
ConsistentQuotesInMultiline: true
|
116
|
+
|
117
|
+
# Solargraph needs to see a class inherited from Struct to recognize
|
118
|
+
# what's going on
|
119
|
+
Style/StructInheritance:
|
120
|
+
Enabled: false
|
121
|
+
|
122
|
+
# I like trailing commas in arrays and hashes. They let me insert new
|
123
|
+
# elements and see them as one line in a diff, not two.
|
124
|
+
Style/TrailingCommaInArrayLiteral:
|
125
|
+
EnforcedStyleForMultiline: comma
|
126
|
+
|
127
|
+
Style/TrailingCommaInHashLiteral:
|
128
|
+
EnforcedStyleForMultiline: comma
|
129
|
+
|
130
|
+
# If I'm using one function name and returning the contents of an
|
131
|
+
# attribute, that's OK. The alternative would be this, which I find
|
132
|
+
# confusing and often not really what I mean:
|
133
|
+
#
|
134
|
+
# attr_reader :something_else
|
135
|
+
# alias_method :something, :something_else
|
136
|
+
Style/TrivialAccessors:
|
137
|
+
ExactNameMatch: true
|
138
|
+
|
139
|
+
AllCops:
|
140
|
+
NewCops: enable
|
141
|
+
TargetRubyVersion: 3.0
|
142
|
+
Exclude:
|
143
|
+
- 'bin/*'
|
144
|
+
- 'vendor/**/*'
|
145
|
+
|
146
|
+
require:
|
147
|
+
- rubocop-rake
|
148
|
+
- rubocop-rspec
|
data/.solargraph.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
include:
|
3
|
+
- "**/*.rb"
|
4
|
+
- ".git-hooks/**/*.rb"
|
5
|
+
exclude:
|
6
|
+
- spec/**/*
|
7
|
+
- feature/**/*
|
8
|
+
- test/**/*
|
9
|
+
- vendor/**/*
|
10
|
+
- ".bundle/**/*"
|
11
|
+
require: []
|
12
|
+
domains: []
|
13
|
+
reporters:
|
14
|
+
- rubocop
|
15
|
+
- require_not_found
|
16
|
+
- typecheck:strong
|
17
|
+
- update_errors
|
18
|
+
formatter:
|
19
|
+
rubocop:
|
20
|
+
cops: safe
|
21
|
+
except: []
|
22
|
+
only: []
|
23
|
+
extra_args: []
|
24
|
+
require_paths: []
|
25
|
+
plugins: []
|
26
|
+
max_files: 5000
|