fix(commitlint): fix header length at 72 chars as agreed#208
fix(commitlint): fix header length at 72 chars as agreed#208myii merged 1 commit intosaltstack-formulas:masterfrom dafyddj:fix/commit-header-length
Conversation
|
Best reviewed: commit by commit
Optimal code review plan
|
| rules: { | ||
| 'body-max-line-length': [2, 'always', 88], | ||
| 'footer-max-line-length': [2, 'always', 88], | ||
| 'header-max-length': [2, 'always', 72] | ||
| } |
There was a problem hiding this comment.
| rules: { | |
| 'body-max-line-length': [2, 'always', 88], | |
| 'footer-max-line-length': [2, 'always', 88], | |
| 'header-max-length': [2, 'always', 72] | |
| } | |
| rules: { | |
| 'body-max-line-length': [2, 'always', 120], | |
| 'footer-max-line-length': [2, 'always', 120], | |
| 'header-max-length': [2, 'always', 72], | |
| }, |
While I like the idea of setting values for body-max-line-length and footer-max-line-length, I'm not sure there are ways to set exceptions for these rules, to allow for content such as long URL references, inline code/error examples or other such "non-prose" text. I've tried this out locally to confirm it prevents the commit.
Otherwise, the suggestion above also formats according to the standard 4-space indent style (which reminds me that I've got an eslint configuration available that could be useful for the js files in our formulas).
UPDATE (https://freenode.logbot.info/saltstack-formulas/20201005#c5350635-c5351022):
- - - 22:01 myii Re: commitlint. Is it? I thought it was still atinfinity, as it shows in the main docs.22:02 myii And how have they proposed to deal with "non-prose" text that gets entered in the commit body? 22:08 dafyddj[m] https://conventional-changelog/commitlint #436 22:08 dafyddj[m] as with the previous change I don't think much thought has gone into it 22:08 myii Oh, great. 22:10 myii They didn't raise any points to argue whether the change was necessary... 22:15 dafyddj[m] no, it all goes back to the same issue around auto generated commits and parity with angular 22:16 myii They didn't like back to Angular conventions. Do you know if it has been set there as well? 22:16 dafyddj[m] i don't know 22:16 myii github.com/angular/angular.js/blob/…DEVELOPERS.md#commit-message-format 22:16 myii Yes, it's limited to 100there, for all lines.22:19 dafyddj[m] but not actually in the angular configuration they provide! 22:19 dafyddj[m] https://github.com/conventional-changelog/c…0commitlint/config-angular/index.js 22:20 myii OK, I suppose that's why the documentation still mentions infinity: commitlint.js.org/#/reference-rules?id=body-max-line-length.22:23 myii Well, the PR seems to have missed a few of the config-*conventions here: github.com/conventional-changelog/c…ommitlint/tree/master/%40commitlint.22:23 myii Specifically config-angular, as you've mentioned.22:32 myii Maybe we should just set a value that we're comfortable with. Gut feeling is that ~120 characters seems to be more than enough. 22:32 myii Any URLs longer than that should be passed through a URL shortener first. 22:33 myii I can't imagine any tracebacks being wider than 120characters.22:35 dafyddj[m] [PROFILE ] Time (in seconds) to render '/tmp/kitchen/srv/pillar/top.sls' using 'jinja' renderer: 0.02788662910461425822:35 dafyddj[m] this is 118 chars, so yes I agree 22:35 myii Apples and oranges I know but: en.wikipedia.org/wiki/Characters_per_line. 22:36 myii I know the Django project uses 119as well.22:36 myii I like your method better! 22:40 myii From that Stack Overflow reference I posted, this is quite interesting to compare with: `git shortlog 22:41 myii Ouch, just found a 204length in theapache-formula:22:44 myii saltstack-formulas/apache-formula fb2f41a 22:45 myii Anyway, let's go with 120and move on from there.
|
Updated my suggestion based on our discussions in Slack. References:
|
|
@dafyddj Once this PR is finalised, please put through a PR to the |
at WG meeting. Fix body/header length to 120 after further discussion.
|
@dafyddj Thanks, let's give another day or so for the others to comment before moving forward with this. |
|
🎉 This PR is included in version 4.2.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
Propagated to all formulas using myii/ssf-formula#265. |
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]Changes related to the build system[chore]Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]Changes to the continuous integration configuration[feat]A new feature[fix]A bug fix[perf]A code change that improves performance[refactor]A code change that neither fixes a bug nor adds a feature[revert]A change used to revert a previous commit[style]Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]Documentation changes[test]Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE?No.
Related issues and/or pull requests
Describe the changes you're proposing
Fix header length at 72 chars as agreed at WG meeting. Fix body/header length to 88.
Upstream configuration (
@config-conventional) has changed in this regard.Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
Documentation checklist
README(e.g.Available states).pillar.example.Testing checklist
state_top).Additional context