git-lint 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba39bef55a904dc640ba7421df9016597bc826faf3263eddb5f3bff2036a00b4
4
- data.tar.gz: 4ea42cc58c1cdb23fff6bd0625e23573b0c13831c4a75115a08fc9d751a32088
3
+ metadata.gz: 1a0ccd4d14bc5a75b14ae5a825f5eec453a560bc3e6df2bc959bbcb90f626794
4
+ data.tar.gz: 5f64925793493c9cde59a4828666137ba6a5203f664d5b97ce994552b38fcb42
5
5
  SHA512:
6
- metadata.gz: 86c24491442dc4e817693138a5b0b822137e2c0627a8c5808576bdee1128480d310269852f013eee7b25cb097ea07ffc6f7f211a2e628b2d88dd97e7f8a26f84
7
- data.tar.gz: acfebc2a5e4f373304f553af56d01f4c6309726d1ac09b1ec1e0edb4cdf76ea3a63fa4d977f6e974b1ed92a6312a5594e18bcd67116f2fd72fd585621a8f5a5c
6
+ metadata.gz: b295196574a134f2ae5a3989c71d7023998eaf96476055a8c511a3f5d684fbaf1d9456fe887389042d4f8a88fb0d7bce0ea8e1a5663c490c1cf7756b9d6384c8
7
+ data.tar.gz: 542818d4e2dced990b4231b53160e6c59272c1db908e309a10566210be26eeddb6213ec1f6581c75b078f6d8581e0b4f85827efe03d0f93ce9a216a8133c94a8
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -14,7 +14,7 @@ image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchem
14
14
  image::https://circleci.com/gh/bkuhlmann/git-lint.svg?style=svg[Circle CI Status]
15
15
 
16
16
  [link=https://travis-ci.org/bkuhlmann/git-lint]
17
- image::https://travis-ci.org/bkuhlmann/git-lint.svg?branch=master[Travis CI Status]
17
+ image::https://travis-ci.org/bkuhlmann/git-lint.svg?branch=main[Travis CI Status]
18
18
  [link=https://app.netlify.com/sites/git-lint/deploys]
19
19
  image::https://api.netlify.com/api/v1/badges/7e23b422-3412-4e7f-b654-65c0417a0b1f/deploy-status[Netlify CI Status]
20
20
 
@@ -27,9 +27,10 @@ toc::[]
27
27
 
28
28
  * Enforces a {git_rebase_workflow_link}.
29
29
  * Enforces a clean and consistent Git commit history.
30
+ * Supports Git default branch configuration.
30
31
  * Provides a customizable suite of analyzers.
31
32
  * Provides Git Hook support for local use.
32
- * Provides Continuous Integration (CI) build server support.
33
+ * Provides Continuous Integration (CI) support.
33
34
 
34
35
  == Screencasts
35
36
 
@@ -66,9 +67,9 @@ git-lint -v, [--version] # Show gem version.
66
67
  To check if your Git commit history is clean, run: `git-lint --analyze`. It will exit with a failure
67
68
  if at least one issue with error severity is detected.
68
69
 
69
- This gem does not check commits on `master`. This is intentional as you would, generally, not want
70
- to rewrite or fix commits on `master`. This gem is best used on feature branches as it automatically
71
- detects all commits made since `master` on the feature branch.
70
+ This gem does not check commits on your default branch (i.e. `main`). This is intentional as you
71
+ would, generally, not want to rewrite or fix commits on the `main` branch. This gem is best used on
72
+ feature branches as it automatically detects all commits made since creation of the feature branch.
72
73
 
73
74
  Here is an example workflow, using gem defaults with issues detected:
74
75
 
@@ -110,6 +111,21 @@ Now, when running `bundle exec rake -T`, you'll see `git_lint` included in the l
110
111
 
111
112
  If you need a concrete example, check out the link:Rakefile[Rakefile] of this project for details.
112
113
 
114
+ === Default Branch
115
+
116
+ Your default branch configuration is respected no matter if it is set globally or locally. If the
117
+ default branch is _not set_ then Git Lint will fall back to `master` for backwards compatibility.
118
+ When the next major version is released, the default branch fallback will change from `master` to
119
+ `main`. You can set your default branch at any time by running the following from the command line:
120
+
121
+ [source,bash]
122
+ ----
123
+ git config --add init.defaultBranch main
124
+ ----
125
+
126
+ 💡 When setting your default branch, ensure you use a consistent Git configuration across all of
127
+ your environments.
128
+
113
129
  === Configuration
114
130
 
115
131
  This gem can be configured via a global configuration:
@@ -288,7 +304,7 @@ maintenance costs for you. To configure global Git Hooks, add the following to y
288
304
  ....
289
305
 
290
306
  Then you can customize Git Hooks for all of your projects.
291
- link:https://github.com/bkuhlmann/dotfiles/tree/master/home_files/.config/git/hooks[Check out these
307
+ link:https://github.com/bkuhlmann/dotfiles/tree/main/home_files/.config/git/hooks[Check out these
292
308
  examples].
293
309
 
294
310
  If a global configuration is not desired, you can add Git Hooks at a per project level by editing
@@ -373,7 +389,7 @@ have a build server that is not listed, please log an issue or provide an implem
373
389
  support.
374
390
 
375
391
  Calculation of commits is done by reviewing all commits made on the feature branch since branching
376
- from `master`.
392
+ from `main`.
377
393
 
378
394
  ==== link:https://circleci.com[Circle CI]
379
395
 
@@ -865,7 +881,7 @@ worth considering:
865
881
  blindly combine multiple commit messages without editing them into a single, coherent message._
866
882
  * Use `git rebase --interactive` when cleaning up commit history, order, messages, etc. This should
867
883
  be done prior to submitting a code review or when code review feedback has been addressed and
868
- you are ready to rebase onto `master`.
884
+ you are ready to rebase onto `main`.
869
885
  * Use `git push --force-with-lease` instead of `git push --force` when pushing changes after an
870
886
  interactive rebasing session.
871
887
  * Avoid checking in development-specific configuration files (add to `.gitignore` instead).
@@ -927,7 +943,7 @@ configuration disabled.
927
943
  === Branches
928
944
 
929
945
  * Use feature branches for new work.
930
- * Maintain branches by rebasing upon `master` on a regular basis.
946
+ * Maintain branches by rebasing upon `main` on a regular basis.
931
947
 
932
948
  === Tags
933
949
 
@@ -949,7 +965,7 @@ configuration disabled.
949
965
  * Use hooks globally rather than locally per project. Doing this applies the same functionality
950
966
  across all projects automatically, reduces maintenance per project, and provides consistency
951
967
  across all projects. This can best be managed via your
952
- link:https://github.com/bkuhlmann/dotfiles/tree/master/home_files/.config/git/hooks[Dotfiles].
968
+ link:https://github.com/bkuhlmann/dotfiles/tree/main/home_files/.config/git/hooks[Dotfiles].
953
969
  * Avoid forcing global or local project hooks as a team-wide mandate. Hooks are a personal tool much
954
970
  like editors or other tools one choose to do their work. For team consistency, use a continuous
955
971
  integration build server instead.
@@ -1016,15 +1032,15 @@ In addition to the objectives above, the following guidelines are worth followin
1016
1032
  implementation. This is _blocking_ and requires immediate correction. The reviewer should
1017
1033
  provide a suggested solution and/or links to patterns, articles, etc. that might help the author
1018
1034
  fix the implementation. Pairing is encouraged if feedback is vast and/or complex.
1019
- ** 🔒 (`:lock:`) - Signifies a security violation that would damage us and/or our customers. This is
1020
- _blocking_ feedback and must be addressed immediately.
1035
+ ** 🔓 (`:unlock:`) - Signifies a security violation that would damage us and/or our customers. This
1036
+ is _blocking_ feedback and must be addressed immediately.
1021
1037
  ** 💡 (`:bulb:`) - Indicates a helpful tip or trick for improving the code. This can be
1022
1038
  _blocking_ or _non-blocking_ feedback and is left up to the author to decide. Generally, it is a
1023
1039
  good idea to address and resolve the feedback.
1024
1040
  ** 🙇 (`:bow:`) - Indicates thankfulness of the feedback received. This is _non-blocking_ and
1025
1041
  always meant as a response to helpful feedback.
1026
1042
  ** ✅ (`:white_check_mark:`) - Signifies code review approval. The author can
1027
- rebase onto `master` and delete the feature branch at this point.
1043
+ rebase onto `main` and delete the feature branch at this point.
1028
1044
  * Use all feedback as a chance to learn, teach, strenghen the bond of trust between you and your
1029
1045
  fellow colleagues, and avoid being cut by
1030
1046
  link:https://fs.blog/2017/04/mental-model-hanlons-razor[Hanlon's Razor].
@@ -1033,13 +1049,13 @@ In addition to the objectives above, the following guidelines are worth followin
1033
1049
  * Use face-to-face communication if a code review's written discussion gets lengthy/noisy.
1034
1050
  * Create follow-up actions if additional features are discovered during a code review to avoid
1035
1051
  delaying code review acceptance. Return to the code review once the new actions have been logged.
1036
- * The author, not the reviewer, should rebase the feature branch onto `master` upon approval.
1037
- * Avoid reviewing your own code review before rebasing onto `master`. Have another pair of eyes
1052
+ * The author, not the reviewer, should rebase the feature branch onto `main` upon approval.
1053
+ * Avoid reviewing your own code review before rebasing onto `main`. Have another pair of eyes
1038
1054
  review your code first.
1039
- * Ensure the following criteria is met before rebasing your feature branch to `master`:
1055
+ * Ensure the following criteria is met before rebasing your feature branch to `main`:
1040
1056
  ** Ensure all `fixup!` and `squash!` commits are interactively rebased. _Avoid rebasing these onto
1041
- the `master` branch!_
1042
- ** Ensure your feature branch is rebased upon `master`.
1057
+ the `main` branch!_
1058
+ ** Ensure your feature branch is rebased upon `main`.
1043
1059
  ** Ensure all tests and code quality checks are passing.
1044
1060
  ** Ensure the feature branch is deleted after being successfully rebased.
1045
1061
 
@@ -1051,12 +1067,12 @@ and editing your merge options for code reviews as follows:
1051
1067
 
1052
1068
  image::https://www.alchemists.io/images/projects/git-lint/screenshots/github-settings-options.png[GitHub Merge Options]
1053
1069
 
1054
- In addition to the above, you'll want to add _branch_ protection rules for your `master` branch. To
1070
+ In addition to the above, you'll want to add _branch_ protection rules for your `main` branch. To
1055
1071
  do this, follow these steps:
1056
1072
 
1057
1073
  . Visit your branch settings (i.e. `https://github.com/<username>/<project>/settings/branches`).
1058
1074
  . Click the _Add rule_ button.
1059
- . For _branch name pattern_, enter: `master`.
1075
+ . For _branch name pattern_, enter: `main`.
1060
1076
  . Check _Require pull request reviews before merging_.
1061
1077
  . Set _Required approving reviews_ to `2` as a minimum.
1062
1078
  . Check _Dismiss stale pull request approvals when new commits are pushed_.
@@ -15,7 +15,7 @@ module Git
15
15
  end
16
16
 
17
17
  def commits
18
- repository.commits "origin/master..#{name}"
18
+ repository.commits "origin/#{repository.branch_default}..#{name}"
19
19
  end
20
20
 
21
21
  private
@@ -15,7 +15,7 @@ module Git
15
15
  end
16
16
 
17
17
  def commits
18
- repository.commits "origin/master..#{name}"
18
+ repository.commits "origin/#{repository.branch_default}..#{name}"
19
19
  end
20
20
 
21
21
  private
@@ -15,7 +15,7 @@ module Git
15
15
  end
16
16
 
17
17
  def commits
18
- repository.commits "master..#{name}"
18
+ repository.commits "#{repository.branch_default}..#{name}"
19
19
  end
20
20
 
21
21
  private
@@ -21,7 +21,7 @@ module Git
21
21
  def commits
22
22
  shell.capture3 "git remote add -f origin #{environment["REPOSITORY_URL"]}"
23
23
  shell.capture3 "git fetch origin #{name}:#{name}"
24
- repository.commits "origin/master..origin/#{name}"
24
+ repository.commits "origin/#{repository.branch_default}..origin/#{name}"
25
25
  end
26
26
 
27
27
  private
@@ -20,7 +20,7 @@ module Git
20
20
 
21
21
  def commits
22
22
  prepare_project
23
- repository.commits "origin/master..#{name}"
23
+ repository.commits "origin/#{repository.branch_default}..#{name}"
24
24
  end
25
25
 
26
26
  private
@@ -35,7 +35,7 @@ module Git
35
35
  shell.capture3 "git fetch original_branch #{name}:#{name}"
36
36
  end
37
37
 
38
- shell.capture3 "git remote set-branches --add origin master"
38
+ shell.capture3 "git remote set-branches --add origin #{repository.branch_default}"
39
39
  shell.capture3 "git fetch"
40
40
  end
41
41
 
@@ -6,7 +6,7 @@ module Git
6
6
  module Identity
7
7
  NAME = "git-lint"
8
8
  LABEL = "Git Lint"
9
- VERSION = "2.1.0"
9
+ VERSION = "2.2.0"
10
10
  VERSION_LABEL = "#{LABEL} #{VERSION}"
11
11
  end
12
12
  end
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: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIC/jCCAeagAwIBAgIBAzANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
- a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMDAzMTUxNDQ1MzJaFw0yMTAzMTUx
15
- NDQ1MzJaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
13
+ MIIC/jCCAeagAwIBAgIBBDANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
+ a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMTAzMTkxMjQ4M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/uTFtgb
25
+ FyjxQk2H0sEWgrRXGGNHBWQRhhEs7LP/TByoC15A0br++xLxRz4r7HBLGAWQQDpg
26
+ 66BJ2TBVjxS6K64tKbq7+ACyrOZGgTfNHACh4M076y0x0oRf/rwBrU39/KRfuhbb
27
+ cm+nNCEtO35gTmZ2bVDHLGvWazi3gJt6+huQjfXTCUUG2YYBxwhu+GPdAGQPxpf9
28
+ lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
29
+ W2A=
30
30
  -----END CERTIFICATE-----
31
- date: 2021-01-19 00:00:00.000000000 Z
31
+ date: 2021-04-04 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: git_plus
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.2'
39
+ version: '0.4'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.2'
46
+ version: '0.4'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: pastel
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  requirements: []
189
- rubygems_version: 3.2.5
189
+ rubygems_version: 3.2.15
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: A command line interface for linting Git commits.
metadata.gz.sig CHANGED
Binary file