Commit Graph

18 Commits

Author SHA1 Message Date
Peter Schrammel 64a3ab5b64 Rename run_lint to run_diff 2017-07-03 17:10:23 +01:00
Peter Schrammel 7af068eb2e Generalise run_lint to run with different tools 2017-07-03 17:09:42 +01:00
Peter Schrammel 428507bc44 Generalise filter_by_diff to output lines between warnings 2017-07-03 16:20:35 +01:00
Peter Schrammel 9714e12920 Rename linter filter script 2017-07-03 16:20:17 +01:00
Nathan Phillips 36dee831ad Check that filter_lint_by_diff.py exists 2017-03-21 14:09:44 +00:00
Nathan Phillips 6bba4ab110 Work across repos
Use the path of the containing repository of the current path, not the one the script is downloaded into
2017-03-21 14:09:26 +00:00
Nathan Phillips 88816e9998 Ignore stdout, only pass errors to filter script 2017-03-21 14:05:48 +00:00
Chris Smowton 317ffbb0f3 Switch to lint filtering by Python script
This avoids number-of-arguments problems, and is briefer to boot.
It does need Python package unidiff however.
2017-02-17 13:02:49 +00:00
Michael Tautschnig 3ceecf6848 Remove explicit "python" as cpplint.py is executable
Follow-up to #433 as suggested by @peterschrammel.
2017-01-18 06:49:44 -08:00
Peter Schrammel 81941be03c Merge pull request #428 from thk123/bug/deleted-file-lint
Run lint script handling deleted files
2017-01-12 16:07:58 +00:00
Peter Schrammel 094c76d73e Merge pull request #427 from NathanJPhillips/feature/allow-lint-from-any-folder
Allow lint to be called from any folder
2017-01-12 16:07:30 +00:00
thk123 a4954cdaf6 Run lint script handling deleted files
Previously we would try and run git blame on a deleted file (since would
still show up in the diff) which would cause an error. Now we just skip
over such files.
2017-01-12 11:00:44 +00:00
NathanJPhillips fe47dec1ea Allow lint to be called from any folder
This allows use of the lint script without changing to the root of the CBMC folder first; e.g. to lint a non-CBMC project
2017-01-12 10:59:44 +00:00
NathanJPhillips 12561ba8f6 Prevent recognising lines by prefix
Add colon to end of pattern to prevent recognising lines that start with the number of a valid line
2017-01-12 10:44:18 +00:00
thk123 4120cddbd1 Detect missing cpplint.py file
If the linting python script is missing, this script fails with a useful
message.
2017-01-11 11:49:24 +00:00
thk123 c35ba68ac0 Don't error if no errors are found
Previously, as we had set -e enabled, the final grep (filtering relevant
errors) would fail if there were no errors to find. This failure was
causing the script to exit with an error code (causing the CI to think
the lint had failed). Now we ignore whether the grep fails or not.
2017-01-11 11:48:53 +00:00
thk123 2633d64a19 Also include errors assoicated with line 0 (e.g. copyright errors).
To do this we need to not error exit if the grep fails to find any valid
lines. We still care about these files (this can happen if, for example,
only lines are removed from the file).
2017-01-10 15:14:28 +00:00
thk123 1bd4476d44 Adding script to run lint check on modified lines
Bash script that uses blame on a range of commits to work out what lines
have
been touched since master. Finally it uses grep to filter the output of
the linting script based only on lines that have been modified.

The yml file that runs the linter has been updated to run  this script.
2017-01-10 15:14:28 +00:00