git-lint 2.2.0 â 2.2.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.tar.gz.sig +0 -0
- data/README.adoc +9 -122
- data/lib/git/lint/cli.rb +1 -4
- data/lib/git/lint/identity.rb +1 -1
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 432f1e46b50a5ae86dc268318ea2a2cf720e68d57a00cbdc274d50379bbee24f
|
4
|
+
data.tar.gz: 5ca784153ebd07153c70b4e7452a7ef0e141b32789e5d4f1c0fb95d861d698b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f53f339560363704e3f35560d3ee5dc6b43012c9eadbf088cd580ddbd0738f6933a16f963406eeb882d2f0d951b95894f7c25a581582c3058074879ab12e3ba
|
7
|
+
data.tar.gz: b5cbe2dbe299a0f3690d64ceb6b2df00074d2112bdbb7bf93c031268705289db782118f19411f0083b592407fc071c84a5311deab01d6afd13e17592a03cb4de
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -747,9 +747,12 @@ Ensures the commit subject uses consistent prefixes that explain _what_ is being
|
|
747
747
|
* *Updated* - Identifies what was updated. The commit should be as small as possible and _not add
|
748
748
|
or fix_ existing behavior. This can sometimes be a grey area but is typically reserved for updates
|
749
749
|
to documentation, code comments, dependencies, etc.
|
750
|
-
* *Refactored* - Identifies what was refactored.
|
751
|
-
|
752
|
-
|
750
|
+
* *Refactored* - Identifies what was refactored.
|
751
|
+
link:https://thoughtbot.com/blog/lets-not-misuse-refactoring[_Refactoring is for changing code
|
752
|
+
structure without changing observable behavior_]. The commit should be as small as possible and
|
753
|
+
not mix multiple kinds of changes at once. Refactored code should never break existing
|
754
|
+
implementation behavior or corresponding specs because, if that happens, then one of the other
|
755
|
+
four prefixes is what you want to use instead.
|
753
756
|
|
754
757
|
In practice, using a prefix other than what has been detailed above to explain _what_ is being
|
755
758
|
committed is never needed. These prefixes are not only short and easy to remember but also have the
|
@@ -947,7 +950,7 @@ configuration disabled.
|
|
947
950
|
|
948
951
|
=== Tags
|
949
952
|
|
950
|
-
* Use tags to denote milestones/releases:
|
953
|
+
* Use tags to denote link:https://www.alchemists.io/projects/milestoner[milestones]/releases:
|
951
954
|
** Makes it easier to record milestones and capture associated release notes.
|
952
955
|
** Makes it easier to compare differences between versions.
|
953
956
|
** Provides a starting point for debugging production issues (if any).
|
@@ -972,124 +975,8 @@ configuration disabled.
|
|
972
975
|
|
973
976
|
=== Code Reviews
|
974
977
|
|
975
|
-
|
976
|
-
|
977
|
-
. *Joy* - The experience of working with you, receiving feedback, giving feedback, and demonstrating
|
978
|
-
a level of care influences others and encourages a collaborative environment that is fun to work
|
979
|
-
in. Use this time to build and reinforce trust amongst your fellow colleagues.
|
980
|
-
. *Quality*: Ensures changes are of highest quality that adhere to team standards while enhancing
|
981
|
-
the customer experience and not disrupting their workflow.
|
982
|
-
. *Education*: Provides a chance for everyone on the team to learn more about the architecture,
|
983
|
-
product/service, and how each member of the team implements a solution. This is your chance to
|
984
|
-
ask questions and learn how to be a better engineer so take advantage of it.
|
985
|
-
|
986
|
-
In addition to the objectives above, the following guidelines are worth following:
|
987
|
-
|
988
|
-
* Keep code reviews short and easy to review:
|
989
|
-
** Review your own code first before submitting to others. By ensuring your are confident in the
|
990
|
-
overall implementation and the commits in terms of commit messages and implementation details,
|
991
|
-
you'll encourage higher quality feedback and show appreciation for the reviewer's time.
|
992
|
-
** Provide a high level overview that answers _why_ the code review is necessary.
|
993
|
-
** Provide a link to the issue that prompted the code review (if any) and any additional details
|
994
|
-
worth highlighting to guide the reviewer through the process.
|
995
|
-
** Provide screenshots/screencasts if possible.
|
996
|
-
** Provide any ancillary notes or points of interest worth highlighting for the reviewer.
|
997
|
-
** Ensure commits within the code review are related to the purpose of the code review and avoid
|
998
|
-
mixing in changes that are ancillary to the primary objective of the code view. If you do have
|
999
|
-
changes outside of the scope of the current code review, open those changes up as a separate code
|
1000
|
-
review instead.
|
1001
|
-
** Prefer code reviews at about 300 lines in order to keep the quality of the code review and defect
|
1002
|
-
detection high. This also shows you value the reviewers time and attention away from their own
|
1003
|
-
work.
|
1004
|
-
** Avoid working on a large issues without first getting feedback in order to not overwhelm/surprise
|
1005
|
-
the maintainers. More discussion up front will help ensure your work has a faster chance of
|
1006
|
-
acceptance.
|
1007
|
-
* Review and rebase code reviews quickly:
|
1008
|
-
** Maintain a consistent but reasonable pace -- Review morning, noon, and night.
|
1009
|
-
** Avoid letting code reviews linger more than a day. Otherwise, you risk hampering moral and
|
1010
|
-
diminishing the productivity of the team.
|
1011
|
-
* Use emojis, with a format of `<emoji> <feedback>`, to identify the kinds of feedback used during
|
1012
|
-
the review process:
|
1013
|
-
** đĩ (`:tea:`) - Signifies you are starting the code review. This is _non-blocking_ and
|
1014
|
-
informational. Useful when reading over a code review with a large number of commits, complex
|
1015
|
-
code, requires additional testing by the reviewer, etc.
|
1016
|
-
** âī¸ (`:star:`) - Signifies code that is liked, favorited, remarkable, etc. This feedback is
|
1017
|
-
_non-blocking_ and is always meant to be positive/uplifting.
|
1018
|
-
** âšī¸ (`:information_source:`) - Signifies informational feedback that is
|
1019
|
-
_non-blocking_. Can also be used to let one know you are done reviewing but haven't approved yet
|
1020
|
-
(due to feedback that needs addressing), rebasing a code review and then merging, waiting for a
|
1021
|
-
blocking code review to be resolved, status updates to the code review, etc.
|
1022
|
-
** đ (`:thought_balloon:`) - Signifies inquisitive intent that is _non-blocking_.
|
1023
|
-
Useful when asking questions and/or probing deeper into implementation details to learn more.
|
1024
|
-
** đ¤ (`:abc:`) - Signifies detection of a misspelling with suggested correction. This is
|
1025
|
-
_blocking_ feedback that is easy to correct.
|
1026
|
-
** đ¨ (`:art:`) - Signifies an issue with code style and/or code quality. This can be _blocking_
|
1027
|
-
or _non-blocking_ feedback. It is up to the discretion of the author on how to address the
|
1028
|
-
feedback but encouraged that the feedback is incorporated or at least discussed. Generally,
|
1029
|
-
these situations are automatically detected via code linters but there are occasions where
|
1030
|
-
there is ambiguity in which linters can't catch.
|
1031
|
-
** đ (`:classical_building:`) - Signifies an issue with the architecture of the
|
1032
|
-
implementation. This is _blocking_ and requires immediate correction. The reviewer should
|
1033
|
-
provide a suggested solution and/or links to patterns, articles, etc. that might help the author
|
1034
|
-
fix the implementation. Pairing is encouraged if feedback is vast and/or complex.
|
1035
|
-
** đ (`:unlock:`) - Signifies a security violation that would damage us and/or our customers. This
|
1036
|
-
is _blocking_ feedback and must be addressed immediately.
|
1037
|
-
** đĄ (`:bulb:`) - Indicates a helpful tip or trick for improving the code. This can be
|
1038
|
-
_blocking_ or _non-blocking_ feedback and is left up to the author to decide. Generally, it is a
|
1039
|
-
good idea to address and resolve the feedback.
|
1040
|
-
** đ (`:bow:`) - Indicates thankfulness of the feedback received. This is _non-blocking_ and
|
1041
|
-
always meant as a response to helpful feedback.
|
1042
|
-
** â
(`:white_check_mark:`) - Signifies code review approval. The author can
|
1043
|
-
rebase onto `main` and delete the feature branch at this point.
|
1044
|
-
* Use all feedback as a chance to learn, teach, strenghen the bond of trust between you and your
|
1045
|
-
fellow colleagues, and avoid being cut by
|
1046
|
-
link:https://fs.blog/2017/04/mental-model-hanlons-razor[Hanlon's Razor].
|
1047
|
-
* Use automation to ensure code reviews are consistent, of high quality, and swift to resolve. Each
|
1048
|
-
code review can be an opportunity to identify and automate the process further.
|
1049
|
-
* Use face-to-face communication if a code review's written discussion gets lengthy/noisy.
|
1050
|
-
* Create follow-up actions if additional features are discovered during a code review to avoid
|
1051
|
-
delaying code review acceptance. Return to the code review once the new actions have been logged.
|
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
|
1054
|
-
review your code first.
|
1055
|
-
* Ensure the following criteria is met before rebasing your feature branch to `main`:
|
1056
|
-
** Ensure all `fixup!` and `squash!` commits are interactively rebased. _Avoid rebasing these onto
|
1057
|
-
the `main` branch!_
|
1058
|
-
** Ensure your feature branch is rebased upon `main`.
|
1059
|
-
** Ensure all tests and code quality checks are passing.
|
1060
|
-
** Ensure the feature branch is deleted after being successfully rebased.
|
1061
|
-
|
1062
|
-
=== GitHub
|
1063
|
-
|
1064
|
-
When using GitHub, enforce a rebase workflow for all of your GitHub projects (_highly recommended_).
|
1065
|
-
You can do this via your project options (i.e. `https://github.com/<username/<project>/settings`)
|
1066
|
-
and editing your merge options for code reviews as follows:
|
1067
|
-
|
1068
|
-
image::https://www.alchemists.io/images/projects/git-lint/screenshots/github-settings-options.png[GitHub Merge Options]
|
1069
|
-
|
1070
|
-
In addition to the above, you'll want to add _branch_ protection rules for your `main` branch. To
|
1071
|
-
do this, follow these steps:
|
1072
|
-
|
1073
|
-
. Visit your branch settings (i.e. `https://github.com/<username>/<project>/settings/branches`).
|
1074
|
-
. Click the _Add rule_ button.
|
1075
|
-
. For _branch name pattern_, enter: `main`.
|
1076
|
-
. Check _Require pull request reviews before merging_.
|
1077
|
-
. Set _Required approving reviews_ to `2` as a minimum.
|
1078
|
-
. Check _Dismiss stale pull request approvals when new commits are pushed_.
|
1079
|
-
. Check _Require review from Code Owners_.
|
1080
|
-
. Check _Require status checks to pass before merging_.
|
1081
|
-
. Check _Require branches to be up to date before merging_.
|
1082
|
-
. Check _Require signed commits_.
|
1083
|
-
. Check _Require linear history_ (pairs well with the merge options mentioned above).
|
1084
|
-
. Check _Include administrators_.
|
1085
|
-
. Uncheck _Allow force pushes_.
|
1086
|
-
. Uncheck _Allow deletions_.
|
1087
|
-
|
1088
|
-
With the above applied, you should have the following result:
|
1089
|
-
|
1090
|
-
image::https://www.alchemists.io/images/projects/git-lint/screenshots/github-settings-branch_protections.png[GitHub Branch Protections]
|
1091
|
-
|
1092
|
-
Applying the above changes will help maintain a clean Git history.
|
978
|
+
For an in depth look at how to conduct code reviews, please read my
|
979
|
+
link:https://www.alchemists.io/articles/code_reviews[article] on this subject to learn more.
|
1093
980
|
|
1094
981
|
== Development
|
1095
982
|
|
data/lib/git/lint/cli.rb
CHANGED
@@ -71,10 +71,7 @@ module Git
|
|
71
71
|
|
72
72
|
desc "--hook", "Add Git Hook support."
|
73
73
|
map "--hook" => :hook
|
74
|
-
method_option :commit_message,
|
75
|
-
desc: "Analyze commit message.",
|
76
|
-
banner: "PATH",
|
77
|
-
type: :string
|
74
|
+
method_option :commit_message, desc: "Analyze commit message.", banner: "PATH", type: :string
|
78
75
|
def hook
|
79
76
|
if options.commit_message?
|
80
77
|
check_commit_message options.commit_message
|
data/lib/git/lint/identity.rb
CHANGED
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.2.
|
4
|
+
version: 2.2.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: 2021-
|
31
|
+
date: 2021-06-04 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: git_plus
|
@@ -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.
|
189
|
+
rubygems_version: 3.2.19
|
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
|