Commit Graph

56 Commits

Author SHA1 Message Date
Oliver Smith 497ce6743a lint: exclude *.ok, *.err
Complains about e.g. \r\n in *.ok files.

Related: OS#5087
Change-Id: I79004cec3e2eb753951a7f886318ac0db4ea2c06
2021-07-07 11:28:37 +02:00
Oliver Smith 57804faacc lint: checkpatch.pl: exclude pattern, not dir
Allow to exclude files in a follow-up commit, not just directories.

Related: OS#5087
Change-Id: Ic3990fba60060c331c479174183924b9cdbdb4c8
2021-07-07 11:28:16 +02:00
Oliver Smith d58b999e0f lint: add helper scripts
Add lint_diff.sh, which runs checkpatch on git diff to either HEAD~1 (if
the tree is clean) or HEAD. This can be used as pre-commit hook, and
it's what jenkins will run.

Add lint_all.sh, which runs checkpatch on a whole repository to test if
the rules we are checking for make sense in Osmocom context.

Related: OS#5087
Change-Id: I1d02c169b05fb05b87209a444a5ddb86efc99d04
2021-06-16 16:49:47 +02:00
Oliver Smith 1e750ed6dc lint/checkpatch: add Osmocom specific wrapper
Related: OS#5087
Change-Id: I0ec6a3bc57a4d31c821fa83370f05c6d4ac2a5b0
2021-06-16 16:42:18 +02:00
Oliver Smith 6c497c076b lint/checkpatch: add --exclude argument
Apply patch from https://review.coreboot.org/c/coreboot/+/18568/, so we
can exclude specific directories.

Related: OS#5087
Change-Id: Ia980814895249f839873c5002f0d21c0e59ee01d
2021-06-16 16:42:18 +02:00
Oliver Smith 47ba23b820 lint/checkpatch: import from Linux kernel
Prepare to run checkpatch on patches submitted to gerrit to point out
various linting errors automatically, such as { after functions not
placed on a new line, or common spelling errors.

Import version from 7e6cdd7f ("checkpatch: improve ALLOC_ARRAY_ARGS test")
of linux.git.

Related: OS#5087
Related: https://osmocom.org/projects/cellular-infrastructure/wiki/Linting
Change-Id: I58571a0409e79d88d37e8328f41a540a58cfb198
2021-06-16 16:41:56 +02:00