| 1 |
# check-all-the-things |
| 2 |
|
| 3 |
This is a tool to run many tools that can check various things. |
| 4 |
It is probably not suitable for running in untrusted directories |
| 5 |
since there could be unknown interactions leading to code execution |
| 6 |
or commands that do code execution but are not yet known to do that. |
| 7 |
|
| 8 |
## Philosophy |
| 9 |
|
| 10 |
### Check as much as possible |
| 11 |
|
| 12 |
Every tool that is available should be run, check all the things! |
| 13 |
|
| 14 |
### Decisions are up to the humans |
| 15 |
|
| 16 |
Humans are capable of making decisions but they are bad at finding |
| 17 |
the information that might help with making decisions. Provide the |
| 18 |
humans with as much information as possible to help them make the |
| 19 |
decisions. Some tools will produce output that is not useful so |
| 20 |
the output of those commands should be filtered. Output from tools |
| 21 |
that produce only machine-readable information should be converted |
| 22 |
to human-readable information. |
| 23 |
|
| 24 |
### Leave details to the tools |
| 25 |
|
| 26 |
When a tool can recursively search a tree and automatically decide |
| 27 |
what to check, let it. For tools that are less intelligent, pass |
| 28 |
single filenames with {file} or multiple filenames with {files}. |
| 29 |
If a tool gains new capabilities that are provided by a hacky |
| 30 |
check via grep, drop the hacky check via grep. The {njobs} parameter |
| 31 |
can be used when a tool knows how to check things in parallel. |
| 32 |
|
| 33 |
## How to contribute |
| 34 |
|
| 35 |
If you have access to collab-maint, please commit trivial things such |
| 36 |
as typos, TODO entries or support for new checkers. |
| 37 |
|
| 38 |
https://anonscm.debian.org/cgit/collab-maint/check-all-the-things.git |
| 39 |
|
| 40 |
When adding support for new checkers, please ensure that you add the |
| 41 |
'dangerous' flag for checks that execute package code. |
| 42 |
|
| 43 |
When adding support for new checkers that are dangerous when run in |
| 44 |
untrusted directories, please make sure that you mitigate this issue |
| 45 |
to ensure that the check does *not* execute package code. If there is |
| 46 |
no option for this, you can flag the check 'run-in-tmp-dir' and then |
| 47 |
cats will automatically update the command to execute in a subshell |
| 48 |
and change to a safe temporary directory first. Anything that directly |
| 49 |
or indirectly uses the commands or software listed below needs flagging. |
| 50 |
The check can refer to the current directory using the {cwd} variable. |
| 51 |
Please also verify that the check does not execute package code. |
| 52 |
|
| 53 |
* Lua |
| 54 |
* Python with `-c`, `-m` or `-` options. |
| 55 |
|
| 56 |
You can also flag the check 'run-in-root-dir' and then cats will |
| 57 |
automatically update the command to execute in a subshell and |
| 58 |
change to the root directory first. This flag can be used instead |
| 59 |
of 'run-in-tmp-dir' to create a simpler shell command when the |
| 60 |
tools used by the check are safe when in the root directory. |
| 61 |
|
| 62 |
When adding support for new checkers that are written in perl, please |
| 63 |
make sure that you mitigate the effects of Debian perl bug #588017 to |
| 64 |
ensure that the check does *not* execute package code. If you flag |
| 65 |
the check perl-bug-588017 then cats will automatically prefix the |
| 66 |
command with `env PERL5OPT=-m-lib=.`, which usually mitigates this. |
| 67 |
Please also verify that the check does not execute package code. |
| 68 |
|
| 69 |
When adding support for new checkers, please ensure that you use {file} |
| 70 |
for checkers that take only one argument and that you use {files} for |
| 71 |
checkers that take more than one argument. |
| 72 |
|
| 73 |
When the support for a check is suboptimal, you can add fixme to the flags |
| 74 |
field and add a comment with info about what needs to be fixed. |
| 75 |
|
| 76 |
Some common comments for fixme flags are available with additional flags: |
| 77 |
|
| 78 |
fixme-silent: when commands need an option to be more silent |
| 79 |
fixme-ignore: when commands need an option to ignore some paths |
| 80 |
|
| 81 |
When adding TODO entries, please add a new check config but set the flags |
| 82 |
field to todo and add any known hints in the apt/comment/command fields. |
| 83 |
|
| 84 |
When adding TODO entries for packages not in Debian, please either add |
| 85 |
the ITP bug number or a URL to upstream in the comment field. |
| 86 |
|
| 87 |
For ITP bugs or when reporting bugs on other tools that show up in |
| 88 |
check-all-the-things, please mark the bug as affecting check-all-the-things |
| 89 |
and please usertag the bugs as mentioned in the bugs section below. |
| 90 |
|
| 91 |
For more involved changes to the code you might want to file a bug to |
| 92 |
discuss the changes with people who are interested. |
| 93 |
|
| 94 |
For low-latency discussion you can join the Debian QA IRC channel: |
| 95 |
|
| 96 |
ircs://irc.oftc.net/debian-qa |
| 97 |
https://webchat.oftc.net/?channels=debian-qa |
| 98 |
|
| 99 |
Please sign all of your commits and tags with OpenPGP: |
| 100 |
|
| 101 |
https://mikegerwitz.com/papers/git-horror-story |
| 102 |
|
| 103 |
Before releases, update lists of extensions copied from elsewhere: |
| 104 |
|
| 105 |
git grep -C1 TODO.*releases |
| 106 |
|
| 107 |
Every release should proclaim to be the "Check all the things" release, |
| 108 |
but the phrase needs to be mutated for each release to a similar phrase. |
| 109 |
|
| 110 |
Tags should be created using this command and the tag annotation should |
| 111 |
be the release notes for this version, usually stuff from debian/changelog. |
| 112 |
|
| 113 |
git tag -a -s check-all-the-things-$(date -u --iso-8601 | tr - .) |
| 114 |
|
| 115 |
You can use 'cats' as the abbreviation of check-all-the-things. Meow! |
| 116 |
|
| 117 |
## Bugs |
| 118 |
|
| 119 |
ITP bugs and bugs filed against other packages should be marked as |
| 120 |
affecting check-all-the-things and usertagged as below. |
| 121 |
|
| 122 |
The user for usertags is [email protected] |
| 123 |
|
| 124 |
These usertags should be used: |
| 125 |
|
| 126 |
new-check: for ITPs or bugs that block the addition of new checks |
| 127 |
new-issues: for requests to check new issues in particular checker tools |
| 128 |
noise: for bugs in particular checkers that make unnecessary noise |
| 129 |
false-positive: for false positives in particular checker tools |
| 130 |
file-detection: for issues related to choice of files to check |
| 131 |
rm-check: for bugs related to the removal of tools used by checks |
| 132 |
|
| 133 |
Please feel free to add new usertags and document them here. |
| 134 |
|
| 135 |
For example: |
| 136 |
|
| 137 |
To: [email protected] |
| 138 |
|
| 139 |
User: [email protected] |
| 140 |
Usertags: new-check |
| 141 |
Control: affects -1 check-all-the-things |
| 142 |
|
| 143 |
To: [email protected] |
| 144 |
|
| 145 |
user [email protected] |
| 146 |
usertags 123456 + new-check |
| 147 |
affects 123456 + check-all-the-things |