History log of /openbmc/openbmc-build-scripts/config/gitlint/ (Results 1 – 2 of 2)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
e08ffba805-Dec-2022 Patrick Williams <patrick@stwcx.xyz>

python: fix flake8 warnings and format with black

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ic54f4a3ecf328b0d2c65af5cfd9eb2048d671ad5

fb9948a321-Jun-2022 Ed Tanous <edtanous@google.com>

Enforce commit message style

Throughout the project, it is a manual human process to enforce the idea
of commit message formatting, and leads to more conflict than would
ideally be required for some

Enforce commit message style

Throughout the project, it is a manual human process to enforce the idea
of commit message formatting, and leads to more conflict than would
ideally be required for something that's relatively algorithmic, and
able to be enforced by CI. Jenkins is able to give faster response
times to users, thus ensuring that committers are more likely to be able
to resolve their commit message issues in a timely manner.

This commit adds the gitlint[1] application to our builds, and
integrates its checks with CI in the format-code.sh script. Gitlint
appears to be a relatively active project with a number of releases,
relatively up to date commits on its github, and by the documentation as
well as this authors testing, appears to do exactly what the project
needs in terms of checks.

gitlint has a number of configuration options[2], of which the defaults
appear to be ok for OpenBMCs style requirements. This commit checks in a
.gitlint file that was generated via 'gitlint generate-config' to use as
a starting point.

To avoid impacting the entire project at this time, this commit checks
for the existence of a .openbmc-enforce-gitlint file in the root of the
directory, and uses that to gate its scanning. At some point in the
future, once we've determined this meets our needs, this check will be
removed so that we can enforce this project-wide.

This commit makes use of the gitlint plugin system to support one
important feature that OpenBMC requires for block line length. The
custom line length rule allows:
1. Block comments to exceed the line length limit
2. Signed-Off-By sections to exceed the line length limit
3. Tabbed in sections to exceed the line length limit

Presumably this same mechanism could be used to handle openbmc/openbmc
commits, to allow meta-<name> to precede the title and go over the
allowed limit, but for the moment, format-code.sh does not apply to
openbmc/openbmc, so this would be for a future change to repotest

When these fails, it attempts to give the user a message that conveys
these allowals to let them fix their commit message quickly.

Tested:
Created a commit with a title that was too long, as well as added a
.openbmc-enforce-gitlint file in bmcweb. Ran openbmc-build-scripts and observed.

'''
-: UC1 Line exceeds max length (101>72).
It's possible you intended to use one of the following exceptions:
1. Put logs or bash lines in a quoted section with triple quotes (''') before and after the section
2. Put a long link at the bottom in a footnote. example: [1] https://my_long_link.com
Line that was too long:
: "VERY LONG LOG LINE THAT TAKES WAY TOO MUCH SPACE AND GOES OVER 72 CHARACTERS, which is a problem"
'''

[1] https://jorisroovers.com/gitlint/
[2] https://jorisroovers.com/gitlint/configuration/
[3] https://jorisroovers.com/gitlint/user_defined_rules/
[4] https://github.com/jorisroovers/gitlint/issues/255#issuecomment-1063494186

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If42a22bfeca223fd5bc8f35ed937aa5f60713f2a

show more ...


/openbmc/openbmc-build-scripts/.gitignore
/openbmc/openbmc-build-scripts/.shellcheck
/openbmc/openbmc-build-scripts/LICENSE
/openbmc/openbmc-build-scripts/OWNERS
/openbmc/openbmc-build-scripts/README.md
/openbmc/openbmc-build-scripts/build-jenkins.sh
/openbmc/openbmc-build-scripts/build-rootfs-size-docker.sh
/openbmc/openbmc-build-scripts/build-setup.sh
/openbmc/openbmc-build-scripts/config/.gitlint
/openbmc/openbmc-build-scripts/config/eslint-global-config.json
block_comment.py
/openbmc/openbmc-build-scripts/config/openbmc-spelling-ignore.txt
/openbmc/openbmc-build-scripts/config/openbmc-spelling.txt
/openbmc/openbmc-build-scripts/docs-build.sh
/openbmc/openbmc-build-scripts/initramfs-build.sh
/openbmc/openbmc-build-scripts/jenkins/README.md
/openbmc/openbmc-build-scripts/jenkins/build-seed
/openbmc/openbmc-build-scripts/jenkins/run-build-script-ci
/openbmc/openbmc-build-scripts/jenkins/run-meta-ci
/openbmc/openbmc-build-scripts/jenkins/userid-validation
/openbmc/openbmc-build-scripts/kernel-build-setup.sh
/openbmc/openbmc-build-scripts/kernel-build.sh
/openbmc/openbmc-build-scripts/openpower-build-setup.sh
/openbmc/openbmc-build-scripts/qemu-build.sh
/openbmc/openbmc-build-scripts/run-qemu-robot-test.sh
/openbmc/openbmc-build-scripts/run-rootfs-size-docker.sh
/openbmc/openbmc-build-scripts/run-unit-test-docker.sh
/openbmc/openbmc-build-scripts/scripts/boot-qemu-test.exp
/openbmc/openbmc-build-scripts/scripts/boot-qemu.sh
/openbmc/openbmc-build-scripts/scripts/build-qemu-robot-docker.sh
/openbmc/openbmc-build-scripts/scripts/build-unit-test-docker
/openbmc/openbmc-build-scripts/scripts/clean-unit-test-docker
/openbmc/openbmc-build-scripts/scripts/dbus-unit-test.py
/openbmc/openbmc-build-scripts/scripts/format-code.sh
/openbmc/openbmc-build-scripts/scripts/generate-html-index.py
/openbmc/openbmc-build-scripts/scripts/get_unit_test_report.py
/openbmc/openbmc-build-scripts/scripts/repositories.txt
/openbmc/openbmc-build-scripts/scripts/run-robot.sh
/openbmc/openbmc-build-scripts/scripts/test-qemu
/openbmc/openbmc-build-scripts/scripts/unit-test.py
/openbmc/openbmc-build-scripts/test-distro.sh
/openbmc/openbmc-build-scripts/tools/owners
/openbmc/openbmc-build-scripts/trace-kernel-build.sh
/openbmc/openbmc-build-scripts/u-boot-build.sh