Treewide changes touching a single area or topic should have the
area/subsystem at the start of the commit message. Treewide is very
ambigous.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We don't need to have two different sets of Zephyr-specific default
values overriding one another, it's confusing.
Note this commit makes NO functional change, the effective defaults stay
the same. It does however make it easier to change defaults in the
future.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Make the error messages which appear in CI for invalid commit messages
match the text in the documentation which describes the rules for
commit messages exactly. This hopefully makes it easier for people to
read failing CI results and map them to documentation links describing
what to do instead.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
This PR clarifies the violation messages emitted by gitlint when
checking the commit message. For example:
* Before: `43: UC4 Line exceeds max length (N>75): "..."`
* After: `43: UC4 Commit line exceeds max length (N>75): "..."`
This makes it easier to identify the source of the error since there is
currently no additional context besides the error code UC*. I recently
pushed a commit that had some sample code as part of the commit body
that exceeded the lenght limit, and thought the error was referring to
one of my source files based on the line it showed. (feel free to laugh
at me, but let's make it better for the next person)
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Add a new gitlint user rule to block unwanted commit tags, and set it up
to block Gerrit Change-Id tags.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Non-empty sequences are truthy in Python, so len() can be skipped in
tests.
Fixes this pylint warning:
scripts/gitlint/zephyr_commit_rules.py:115:11: C1801: Do not use
`len(SEQUENCE)` to determine if a sequence is empty
(len-as-condition)
Fixing warnings for a CI check.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Fixes pylint warnings like this one:
doc/conf.py:325:0: W1401: Anomalous backslash in string: '\s'.
String constant might be missing an r prefix.
(anomalous-backslash-in-string)
The reason for this warning is that backslash escapes are interpreted in
non-raw (non-r-prefixed) strings. For example, '\a' and r'\a' are not
the same string (first one has a single ASCII bell character, second one
has two characters).
It just happens that there's no \s (or \., or \/) escape for example,
and '\s' turns into two characters (as needed for a regex). It's risky
to rely on stuff like that regexes though. Best to make them raw strings
unless they're super trivial.
Also note that '\s' and '\\s' turn into the same string.
Another tip: A literal ' can be put into a string with "blah'blah"
instead of 'blah\'blah'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Needs to be at the beginning of the file. Fixes a pylint warning:
scripts/process_gperf.py:26:-1: W0105: String statement has no
effect (pointless-string-statement)
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The commit header as added by "git commit -s" is "Signed-off-by:",
and not any other casing. While it perhaps case-insensitive, use
canonical casing to not confuse (attentive) users.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commit messages should not start with literal "subsys:", instead, spell
out the actual subsystem name.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
It has been agreed in the project TSC to reject commit messages without
any content. Every commit message needs some explaination beyond what
was put in the title, even the most trivial ones.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The revert commit title is usually prefixed with "Revert" which causes
the title to become longer than the allowed limit. Allow such commits to
keep revert commits consistent with the original commit message.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When including referecnes to external resources using a URL, keep the
line with URL in one line to not break the link and allow this to pass
the gitlint test.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When checking for line length limits, ignore lines with Signed-off-by.
Some developers have a long name that would not fit within the limits.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Make sure we get full name in the commit message and not the username or
some incomplete data that we need to decipher. We still need to verify
the commiter name that is not part of the commit message body, but this
is out of scope of gitlint.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Install gitlint using pip:
# pip install gitlint
# gitlint install-hook
This will install the pre-commit hook.
Policies are define in .gitlint. Custom rules are available under
scripts/gitlint.
This script will also run in CI, so avoid CI errors by using the hook
above.
Change-Id: I62750a1fd9369341db29c413a6c4a1677bb0db8a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>