git-lint 3.0.2 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +2 -10
- data/exe/git-lint +0 -1
- data/git-lint.gemspec +37 -0
- data/lib/git/lint/analyzers/commit_subject_prefix.rb +5 -1
- data/lib/git/lint/cli/parsers/core.rb +8 -3
- data/lib/git/lint/cli/shell.rb +3 -1
- data/lib/git/lint/commits/container.rb +4 -2
- data/lib/git/lint/configuration/loader.rb +1 -1
- data/lib/git/lint/container.rb +3 -0
- data/lib/git/lint/errors/base.rb +1 -1
- data/lib/git/lint/reporters/branch.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +25 -10
- metadata.gz.sig +0 -0
- data/lib/git/lint/identity.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1164929cb481c775af80c321bdb9d4956cfedd86ee0372f4d901bb1cc28f3d75
|
4
|
+
data.tar.gz: 93be0599671af1755a9412bca96ae94946da3b9eb48a488094306eb1c463c3d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f26ce06aa7544714ebaeaf3388dc6a72104c5682917cfbe6695b5b606a7876d801fc3956acfc09bae12bbb12e8cba48adb450ba7b3339fe06e4fd45344dab205
|
7
|
+
data.tar.gz: b80d78986295f05dae5e2792ea539dde452a9f57512698ea2f47ddf662bd48005d6ca509e2a4ce877e443099d3a826f8fbeb055509ca5510fa1a8dbfdbdc8f4e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -6,15 +6,6 @@
|
|
6
6
|
|
7
7
|
= Git Lint
|
8
8
|
|
9
|
-
[link=http://badge.fury.io/rb/git-lint]
|
10
|
-
image::https://badge.fury.io/rb/git-lint.svg[Gem Version]
|
11
|
-
[link=https://www.alchemists.io/projects/code_quality]
|
12
|
-
image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchemists Style Guide]
|
13
|
-
[link=https://circleci.com/gh/bkuhlmann/git-lint]
|
14
|
-
image::https://circleci.com/gh/bkuhlmann/git-lint.svg?style=svg[Circle CI Status]
|
15
|
-
[link=https://app.netlify.com/sites/git-lint/deploys]
|
16
|
-
image::https://api.netlify.com/api/v1/badges/7e23b422-3412-4e7f-b654-65c0417a0b1f/deploy-status[Netlify CI Status]
|
17
|
-
|
18
9
|
Git Lint is a command line interface for linting Git commits by ensuring you maintain a clean, easy
|
19
10
|
to read, debuggable, and maintainable project history. Having a consistent commit history leads to
|
20
11
|
improved code reviews and is a perfect companion to tools like
|
@@ -423,7 +414,8 @@ jobs:
|
|
423
414
|
container:
|
424
415
|
image: ruby:latest
|
425
416
|
steps:
|
426
|
-
-
|
417
|
+
- name: Checkout
|
418
|
+
uses: actions/checkout@v2
|
427
419
|
with:
|
428
420
|
fetch-depth: '0'
|
429
421
|
ref: ${{github.head_ref}}
|
data/exe/git-lint
CHANGED
data/git-lint.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "git-lint"
|
5
|
+
spec.version = "3.3.1"
|
6
|
+
spec.authors = ["Brooke Kuhlmann"]
|
7
|
+
spec.email = ["brooke@alchemists.io"]
|
8
|
+
spec.homepage = "https://www.alchemists.io/projects/git-lint"
|
9
|
+
spec.summary = "A command line interface for linting Git commits."
|
10
|
+
spec.license = "Hippocratic-3.0"
|
11
|
+
|
12
|
+
spec.metadata = {
|
13
|
+
"bug_tracker_uri" => "https://github.com/bkuhlmann/git-lint/issues",
|
14
|
+
"changelog_uri" => "https://www.alchemists.io/projects/git-lint/versions",
|
15
|
+
"documentation_uri" => "https://www.alchemists.io/projects/git-lint",
|
16
|
+
"label" => "Git Lint",
|
17
|
+
"rubygems_mfa_required" => "true",
|
18
|
+
"source_code_uri" => "https://github.com/bkuhlmann/git-lint"
|
19
|
+
}
|
20
|
+
|
21
|
+
spec.signing_key = Gem.default_key_path
|
22
|
+
spec.cert_chain = [Gem.default_cert_path]
|
23
|
+
|
24
|
+
spec.required_ruby_version = "~> 3.1"
|
25
|
+
spec.add_dependency "dry-container", "~> 0.9.0"
|
26
|
+
spec.add_dependency "git_plus", "~> 1.1"
|
27
|
+
spec.add_dependency "pastel", "~> 0.8"
|
28
|
+
spec.add_dependency "refinements", "~> 9.2"
|
29
|
+
spec.add_dependency "runcom", "~> 8.2"
|
30
|
+
spec.add_dependency "spek", "~> 0.0"
|
31
|
+
spec.add_dependency "zeitwerk", "~> 2.5"
|
32
|
+
|
33
|
+
spec.bindir = "exe"
|
34
|
+
spec.executables << "git-lint"
|
35
|
+
spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
|
36
|
+
spec.files = Dir["*.gemspec", "lib/**/*"]
|
37
|
+
end
|
@@ -6,7 +6,7 @@ module Git
|
|
6
6
|
# Analyzes commit subject uses standard prefix.
|
7
7
|
class CommitSubjectPrefix < Abstract
|
8
8
|
def valid?
|
9
|
-
return true if
|
9
|
+
return true if locally_prefixed?
|
10
10
|
return true if filter_list.empty?
|
11
11
|
|
12
12
|
commit.subject.match?(/\A#{Regexp.union filter_list.to_regexp}/)
|
@@ -21,6 +21,10 @@ module Git
|
|
21
21
|
protected
|
22
22
|
|
23
23
|
def load_filter_list = Kit::FilterList.new(settings.includes)
|
24
|
+
|
25
|
+
def locally_prefixed? = !ci? && commit.prefix?
|
26
|
+
|
27
|
+
def ci? = container[:environment]["CI"] == "true"
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
@@ -12,13 +12,16 @@ module Git
|
|
12
12
|
|
13
13
|
def self.call(...) = new(...).call
|
14
14
|
|
15
|
-
def initialize configuration = Container[:configuration],
|
15
|
+
def initialize configuration = Container[:configuration],
|
16
|
+
client: Parser::CLIENT,
|
17
|
+
container: Container
|
16
18
|
@configuration = configuration
|
17
19
|
@client = client
|
20
|
+
@container = container
|
18
21
|
end
|
19
22
|
|
20
23
|
def call arguments = []
|
21
|
-
client.banner =
|
24
|
+
client.banner = specification.labeled_summary
|
22
25
|
client.separator "\nUSAGE:\n"
|
23
26
|
collate
|
24
27
|
client.parse arguments
|
@@ -27,7 +30,7 @@ module Git
|
|
27
30
|
|
28
31
|
private
|
29
32
|
|
30
|
-
attr_reader :configuration, :client
|
33
|
+
attr_reader :configuration, :client, :container
|
31
34
|
|
32
35
|
def collate = private_methods.sort.grep(/add_/).each { |method| __send__ method }
|
33
36
|
|
@@ -65,6 +68,8 @@ module Git
|
|
65
68
|
configuration.merge! action_help: true
|
66
69
|
end
|
67
70
|
end
|
71
|
+
|
72
|
+
def specification = container[__method__]
|
68
73
|
end
|
69
74
|
end
|
70
75
|
end
|
data/lib/git/lint/cli/shell.rb
CHANGED
@@ -34,7 +34,7 @@ module Git
|
|
34
34
|
in action_analyze: true, analyze_sha: String => sha then analyze_commit sha
|
35
35
|
in action_config: Symbol => action then config action
|
36
36
|
in action_hook: Pathname => path then hook path
|
37
|
-
in action_version: true then logger.info
|
37
|
+
in action_version: true then logger.info { specification.labeled_version }
|
38
38
|
else usage
|
39
39
|
end
|
40
40
|
end
|
@@ -49,6 +49,8 @@ module Git
|
|
49
49
|
|
50
50
|
def usage = logger.unknown { parser.to_s }
|
51
51
|
|
52
|
+
def specification = container[__method__]
|
53
|
+
|
52
54
|
def logger = container[__method__]
|
53
55
|
end
|
54
56
|
end
|
@@ -10,9 +10,11 @@ module Git
|
|
10
10
|
module Container
|
11
11
|
extend Dry::Container::Mixin
|
12
12
|
|
13
|
-
|
13
|
+
config.registry = ->(container, key, value, _options) { container[key.to_s] = value }
|
14
|
+
|
15
|
+
merge Git::Lint::Container
|
16
|
+
|
14
17
|
register(:shell) { Open3 }
|
15
|
-
register(:environment) { ENV }
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
@@ -15,7 +15,7 @@ module Git
|
|
15
15
|
using ::Refinements::Structs
|
16
16
|
|
17
17
|
DEFAULTS = YAML.load_file(Pathname(__dir__).join("defaults.yml")).freeze
|
18
|
-
CLIENT = Runcom::Config.new "
|
18
|
+
CLIENT = Runcom::Config.new "git-lint/configuration.yml", defaults: DEFAULTS
|
19
19
|
|
20
20
|
def self.call = new.call
|
21
21
|
|
data/lib/git/lint/container.rb
CHANGED
@@ -4,6 +4,7 @@ require "dry-container"
|
|
4
4
|
require "git_plus"
|
5
5
|
require "logger"
|
6
6
|
require "pastel"
|
7
|
+
require "spek"
|
7
8
|
|
8
9
|
module Git
|
9
10
|
module Lint
|
@@ -12,7 +13,9 @@ module Git
|
|
12
13
|
extend Dry::Container::Mixin
|
13
14
|
|
14
15
|
register(:configuration) { Configuration::Loader.call }
|
16
|
+
register(:environment) { ENV }
|
15
17
|
register(:repository) { GitPlus::Repository.new }
|
18
|
+
register(:specification) { Spek::Loader.call "#{__dir__}/../../../git-lint.gemspec" }
|
16
19
|
register(:colorizer) { Pastel.new enabled: $stdout.tty? }
|
17
20
|
register(:kernel) { Kernel }
|
18
21
|
|
data/lib/git/lint/errors/base.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
|
29
29
|
W2A=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2022-
|
31
|
+
date: 2022-02-20 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: dry-container
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '1.
|
53
|
+
version: '1.1'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '1.
|
60
|
+
version: '1.1'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: pastel
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -78,28 +78,42 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '9.
|
81
|
+
version: '9.2'
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '9.
|
88
|
+
version: '9.2'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: runcom
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '8.
|
95
|
+
version: '8.2'
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '8.
|
102
|
+
version: '8.2'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: spek
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0.0'
|
110
|
+
type: :runtime
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0.0'
|
103
117
|
- !ruby/object:Gem::Dependency
|
104
118
|
name: zeitwerk
|
105
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,6 +141,7 @@ files:
|
|
127
141
|
- LICENSE.adoc
|
128
142
|
- README.adoc
|
129
143
|
- exe/git-lint
|
144
|
+
- git-lint.gemspec
|
130
145
|
- lib/git/lint.rb
|
131
146
|
- lib/git/lint/analyzer.rb
|
132
147
|
- lib/git/lint/analyzers/abstract.rb
|
@@ -174,7 +189,6 @@ files:
|
|
174
189
|
- lib/git/lint/errors/base.rb
|
175
190
|
- lib/git/lint/errors/severity.rb
|
176
191
|
- lib/git/lint/errors/sha.rb
|
177
|
-
- lib/git/lint/identity.rb
|
178
192
|
- lib/git/lint/kit/filter_list.rb
|
179
193
|
- lib/git/lint/parsers/trailers/collaborator.rb
|
180
194
|
- lib/git/lint/rake/setup.rb
|
@@ -195,6 +209,7 @@ metadata:
|
|
195
209
|
bug_tracker_uri: https://github.com/bkuhlmann/git-lint/issues
|
196
210
|
changelog_uri: https://www.alchemists.io/projects/git-lint/versions
|
197
211
|
documentation_uri: https://www.alchemists.io/projects/git-lint
|
212
|
+
label: Git Lint
|
198
213
|
rubygems_mfa_required: 'true'
|
199
214
|
source_code_uri: https://github.com/bkuhlmann/git-lint
|
200
215
|
post_install_message:
|
@@ -212,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
227
|
- !ruby/object:Gem::Version
|
213
228
|
version: '0'
|
214
229
|
requirements: []
|
215
|
-
rubygems_version: 3.3.
|
230
|
+
rubygems_version: 3.3.7
|
216
231
|
signing_key:
|
217
232
|
specification_version: 4
|
218
233
|
summary: A command line interface for linting Git commits.
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/git/lint/identity.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Git
|
4
|
-
module Lint
|
5
|
-
# Gem identity information.
|
6
|
-
module Identity
|
7
|
-
NAME = "git-lint"
|
8
|
-
LABEL = "Git Lint"
|
9
|
-
VERSION = "3.0.2"
|
10
|
-
VERSION_LABEL = "#{LABEL} #{VERSION}".freeze
|
11
|
-
SUMMARY = "A command line interface for linting Git commits."
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|