Skip to content

fix(commitlint): fix header length at 72 chars as agreed#208

Merged
myii merged 1 commit intosaltstack-formulas:masterfrom
dafyddj:fix/commit-header-length
Oct 6, 2020
Merged

fix(commitlint): fix header length at 72 chars as agreed#208
myii merged 1 commit intosaltstack-formulas:masterfrom
dafyddj:fix/commit-header-length

Conversation

@dafyddj
Copy link
Copy Markdown
Contributor

@dafyddj dafyddj commented Sep 29, 2020

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

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 tests

Does 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

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

@dafyddj dafyddj requested a review from a team as a code owner September 29, 2020 19:57
@pull-assistant
Copy link
Copy Markdown

Score: 1.00

Best reviewed: commit by commit


Optimal code review plan

     fix(commitlint): fix header length at 72 chars as agreed

Powered by Pull Assistant. Last update 4672e7d ... 4672e7d. Read the comment docs.

Comment thread commitlint.config.js Outdated
Comment on lines +3 to +7
rules: {
'body-max-line-length': [2, 'always', 88],
'footer-max-line-length': [2, 'always', 88],
'header-max-length': [2, 'always', 72]
}
Copy link
Copy Markdown
Contributor

@myii myii Oct 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 at infinity, 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 100 there, 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 120 characters.
22:35 dafyddj[m] [PROFILE ] Time (in seconds) to render '/tmp/kitchen/srv/pillar/top.sls' using 'jinja' renderer: 0.027886629104614258
22: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 119 as 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 204 length in the apache-formula:
22:44 myii saltstack-formulas/apache-formula fb2f41a
22:45 myii Anyway, let's go with 120 and move on from there.

@myii
Copy link
Copy Markdown
Contributor

myii commented Oct 5, 2020

@myii
Copy link
Copy Markdown
Contributor

myii commented Oct 5, 2020

@dafyddj Once this PR is finalised, please put through a PR to the ssf-formula, so we can propagate this change to all of the formulas.

at WG meeting. Fix body/header length to 120 after further discussion.
@myii
Copy link
Copy Markdown
Contributor

myii commented Oct 5, 2020

@dafyddj Thanks, let's give another day or so for the others to comment before moving forward with this.

@myii myii merged commit b5e11b3 into saltstack-formulas:master Oct 6, 2020
@myii
Copy link
Copy Markdown
Contributor

myii commented Oct 6, 2020

Thanks @dafyddj, we can get this pushed out to the other formulas ASAP.

Appreciate the review, @baby-gnu.

@saltstack-formulas-travis
Copy link
Copy Markdown

🎉 This PR is included in version 4.2.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@myii
Copy link
Copy Markdown
Contributor

myii commented Oct 7, 2020

Propagated to all formulas using myii/ssf-formula#265.

@dafyddj dafyddj deleted the fix/commit-header-length branch November 29, 2024 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants