git-lint 11.0.0 → 11.1.0

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: '09bc2331e668a1ed5e6851a60926668d1d392f4addd54a49ffed7fba63d78fcd'
4
- data.tar.gz: b5937a91c8e8e100e054ef5209f5eb594c8facbca2fbd974acf637f3a147527d
3
+ metadata.gz: 62cc9f5a643edae10bb1f56299e1eb5ddf387077c5dee1a9fd86da6c752911af
4
+ data.tar.gz: abaef08bf9d812e901a7292b750d0434444b707415653b5e1e01ed9ae08e10b1
5
5
  SHA512:
6
- metadata.gz: 6219f9cd5dad3b933a99ce75873c2f9bc8142f5cbf03c6886d2351b29fb1575396b2f4ddc0aff045b0cad546fe14419bd34d90dc1b6262a978d9991523e42a2c
7
- data.tar.gz: a98ad6176494113b9eec2cde32f24412f6e4c361e240afed7260c90cc8e50f384f3d3a23a85f49e430566392d26e619d25fc066b5420f893257bd1642d88f009
6
+ metadata.gz: 67f273ead789248321314633d57dd7c90d84060c7534123ab31fdb87defa325dbeea5f34e22b15abd3a72e1156e46ddd5845afdac0822ca6cb2e68aee8d161df
7
+ data.tar.gz: 9583db5623950eda4dfa83037114be68737fc4f47817c98354c724efad478995b6ad21f38a72253c39003c1cfeeb7a071b82e89096dad818c29acb410ce16370
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -590,7 +590,7 @@ and provides the missing spec to ensure this doesn't happen again.
590
590
  Ensures a minimum number of lines are present within the commit body. Lines with empty characters
591
591
  (i.e. whitespace, carriage returns, etc.) are considered to be empty.
592
592
 
593
- Automatically ignores _fixup!_ commits as they are not meant to have bodies.
593
+ Automatically ignores _fixup!_ directives because they are not meant to have bodies.
594
594
 
595
595
  ==== Commit Body Tracker Shorthand
596
596
 
@@ -675,7 +675,7 @@ Added documentation
675
675
  Added documentation
676
676
  ....
677
677
 
678
- Automatically ignores _amend!_, _fixup!_, or _squash!_ commit prefixes.
678
+ Automatically ignores _amend!_, _fixup!_, and _squash!_ directives.
679
679
 
680
680
  ==== Commit Subject Length
681
681
 
@@ -690,7 +690,7 @@ lenient than the link:http://tbaggery.com/2008/04/19/a-note-about-git-commit-mes
690
690
  rule] as it gives one the ability to formulate a more descriptive subject line without being too
691
691
  wordy or suffer being word wrapped.
692
692
 
693
- Automatically ignores _fixup!_ or _squash!_ commit prefixes when calculating subject length.
693
+ Automatically ignores _amend!_, _fixup!_, and _squash!_ directives.
694
694
 
695
695
  ==== Commit Subject Prefix
696
696
 
@@ -737,8 +737,7 @@ Each prefix is delimited by a space which is the default setting but can be cust
737
737
  Whatever you choose for a delimiter will not affect Git's special bang prefixes as described in the
738
738
  tip below.
739
739
 
740
- 💡 This analyzer automatically ignores _amend!_, _fixup!_, or _squash!_ commit prefixes when used as
741
- a Git Hook in order to not disturb interactive rebase workflows.
740
+ Automatically ignores _amend!_, _fixup!_, and _squash!_ directives.
742
741
 
743
742
  ==== Commit Subject Suffix
744
743
 
@@ -960,6 +959,8 @@ Milestone: patch
960
959
 
961
960
  This key is mandatory by default which means the key must always be present unless the repository is unpublished (i.e. has no origin). When the repository is unpublished, this gives you the freedom to release your initial version (i.e. 0.0.0) without this trailer. Once published, you'll need the trailer. To make the key optional, set mandatory to `false`.
962
961
 
962
+ Automatically ignores _amend!_, _fixup!_, and _squash!_ directives.
963
+
963
964
  ==== Commit Trailer Milestone Value
964
965
 
965
966
  [options="header"]
data/git-lint.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "git-lint"
5
- spec.version = "11.0.0"
5
+ spec.version = "11.1.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/git-lint"
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency "dry-monads", "~> 1.9"
31
31
  spec.add_dependency "dry-schema", "~> 1.15"
32
32
  spec.add_dependency "etcher", "~> 4.3"
33
- spec.add_dependency "gitt", "~> 5.3"
33
+ spec.add_dependency "gitt", "~> 5.4"
34
34
  spec.add_dependency "infusible", "~> 5.0"
35
35
  spec.add_dependency "refinements", "~> 14.0"
36
36
  spec.add_dependency "runcom", "~> 13.0"
@@ -5,19 +5,40 @@ module Git
5
5
  module Analyzers
6
6
  # Analyzes proper capitalization of commit body paragraphs.
7
7
  class CommitBodyParagraphNewLine < Abstract
8
- PATTERN = /
9
- \n # New line.
10
- (?! # Negative lookahead start.
11
- \s{1,} # Indentation.
12
- | # Or.
13
- \s* # Optional whitespace.
14
- \# # Comment character.
15
- ) # Negative lookahead end.
16
- /mx
17
-
18
- def initialize(commit, pattern: PATTERN, **)
8
+ PATTERNS = {
9
+ general: /
10
+ \n # New line.
11
+ (?! # Negative lookahead start.
12
+ \s{1,} # Indentation.
13
+ ) # Negative lookahead end.
14
+ /mx,
15
+ markup: /
16
+ \A # Start of line.
17
+ ( # Start of conditional.
18
+ \s*\# # Optional whitepace with comment.
19
+ | # Or.
20
+ ` # Backtick.
21
+ | # Or.
22
+ - # Dash.
23
+ | # Or.
24
+ _ # Underscore.
25
+ | # Or.
26
+ \+ # Plus.
27
+ | # Or.
28
+ \d+\. # Ordered list item.
29
+ | # Or.
30
+ \. # Unordered list itme.
31
+ | # Or.
32
+ \* # Unordered list itme.
33
+ | # Or.
34
+ \[.*?\] # ASCII Doc code block.
35
+ ) # End of conditional.
36
+ /x
37
+ }.freeze
38
+
39
+ def initialize(commit, patterns: PATTERNS, **)
19
40
  super(commit, **)
20
- @pattern = pattern
41
+ @patterns = patterns
21
42
  end
22
43
 
23
44
  def valid? = invalids.empty?
@@ -33,7 +54,7 @@ module Git
33
54
 
34
55
  private
35
56
 
36
- attr_reader :pattern
57
+ attr_reader :patterns
37
58
 
38
59
  def affected_lines
39
60
  invalids.each.with_object [] do |line, lines|
@@ -42,7 +63,10 @@ module Git
42
63
  end
43
64
 
44
65
  def invalids
45
- @invalids ||= commit.body_paragraphs.grep pattern
66
+ markup = patterns.fetch :markup
67
+ general = patterns.fetch :general
68
+
69
+ @invalids ||= commit.body_paragraphs.grep_v(markup).grep general
46
70
  end
47
71
  end
48
72
  end
@@ -7,9 +7,7 @@ module Git
7
7
  class CommitTrailerMilestoneKey < Abstract
8
8
  include Dependencies[:git, setting: "trailers.milestone"]
9
9
 
10
- def valid?
11
- optional? && affected_commit_trailers.empty?
12
- end
10
+ def valid? = !mandatory? && affected_commit_trailers.empty?
13
11
 
14
12
  def issue
15
13
  return {} if valid?
@@ -32,13 +30,13 @@ module Git
32
30
 
33
31
  private
34
32
 
35
- def optional?
36
- return true unless mandatory?
33
+ def mandatory?
34
+ return false if commit.directive?
37
35
 
38
- commit.trailers.any? { it.key == setting.name }
39
- end
36
+ missing = commit.trailers.none? { it.key == setting.name }
40
37
 
41
- def mandatory? = settings.commits_trailer_milestone_key_mandatory && git.origin?
38
+ settings.commits_trailer_milestone_key_mandatory && git.origin? && missing
39
+ end
42
40
 
43
41
  def hint_prefix
44
42
  settings.commits_trailer_milestone_key_mandatory ? "Use (manditory)" : "Use"
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: 11.0.0
4
+ version: 11.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -125,14 +125,14 @@ dependencies:
125
125
  requirements:
126
126
  - - "~>"
127
127
  - !ruby/object:Gem::Version
128
- version: '5.3'
128
+ version: '5.4'
129
129
  type: :runtime
130
130
  prerelease: false
131
131
  version_requirements: !ruby/object:Gem::Requirement
132
132
  requirements:
133
133
  - - "~>"
134
134
  - !ruby/object:Gem::Version
135
- version: '5.3'
135
+ version: '5.4'
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: infusible
138
138
  requirement: !ruby/object:Gem::Requirement
@@ -347,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
347
347
  - !ruby/object:Gem::Version
348
348
  version: '0'
349
349
  requirements: []
350
- rubygems_version: 4.0.13
350
+ rubygems_version: 4.0.14
351
351
  specification_version: 4
352
352
  summary: A command line interface for linting Git commits.
353
353
  test_files: []
metadata.gz.sig CHANGED
Binary file