Commit Graph

622 Commits

Author SHA1 Message Date
Nick Mathewson
d6ce8527f8 tor-coccinelle.h: add a definition for EXTERN 2019-10-22 09:32:13 -04:00
Nick Mathewson
6696a5bbae tor-coccinelle.h: add HANDLE_{DECL,IMPL} 2019-10-22 09:32:13 -04:00
Nick Mathewson
d129b503c0 tor-coccinelle.h: add EAT_SEMICOLON 2019-10-22 09:32:13 -04:00
Nick Mathewson
2e64dfea95 tor-coccinelle.h: add CHECK_SCANF 2019-10-22 09:32:13 -04:00
Nick Mathewson
7798c53c98 tor-coccinelle.h: add MOCK_DECL 2019-10-22 09:24:25 -04:00
Nick Mathewson
18f1624bbe tor-coccinelle.h: handle SLIST and LIST. 2019-10-22 09:24:25 -04:00
Nick Mathewson
a2bb66c355 Add a "COCCI" macro that we tell coccinelle is always defined.
This will let us give specific in-file equivalents to given macros
or preprocessor directives, to make things parse.
2019-10-22 09:24:25 -04:00
Nick Mathewson
ea47e53252 tor-coccinelle.h: handle NS and NS_DECL. 2019-10-22 09:24:25 -04:00
Nick Mathewson
017c62000c tor-coccinelle: handle SIMPLEQ and TAILQ better. 2019-10-22 09:24:25 -04:00
Nick Mathewson
c13c0c8999 tor-coccinelle.h: Add {EN,DIS}ABLE_GCC_WARNING. 2019-10-22 09:24:25 -04:00
Nick Mathewson
eb1260e346 tor-coccinelle: expect parentheses after HT_INITIALIZER 2019-10-22 09:24:25 -04:00
Nick Mathewson
51c2097586 try_parse.sh: add a verbose mode and a meaningful exit code. 2019-10-22 09:24:25 -04:00
Nick Mathewson
9ab96550da document test-operator-cleanup 2019-10-22 09:24:25 -04:00
Nick Mathewson
4ab85f4928 Document tor-coccinelle.h 2019-10-09 09:23:49 -04:00
Nick Mathewson
25ed698fb8 Add some more of our trickier macros to tor-coccinelle.h
Note that this header file behaves a bit strangely.  It is used by
coccinelle just for the purpose of knowing how to parse
difficult-to-parse stuff.  It doesn't need to produce good C -- just
grammatical C.
2019-09-11 18:45:52 -04:00
Nick Mathewson
c6191983e9 Add a script to tell whether a file can be perfectly parsed by spatch
spatch can let us know whether a file has parsed "perfectly" or
not.  The more perfect it parses, the likelier any semantic patches
are to apply.  I've used this script to identify problem areas in
our code.
2019-09-11 18:44:10 -04:00
Nick Mathewson
9a101c2c0f Add a script to run spatch with appropriate arguments
It's a bit tricky to remember the right incantation to get the
proper include paths and incantations for coccinelle, but without
it, coccinelle is less effective at parsing our C.
2019-09-11 18:43:16 -04:00
Nick Mathewson
e7565855c0 Merge branch 'ticket31578' into ticket31578_merged 2019-09-11 08:59:29 -04:00
David Goulet
796a9b37ea Merge branch 'tor-github/pr/1264' 2019-09-09 14:53:12 -04:00
Nick Mathewson
a642a4cbd7 Merge branch 'ticket30924_042_04_squashed' into ticket30924_042_04_squashed_merged 2019-09-09 11:10:53 -04:00
David Goulet
a8a1ea4e0e practracker: Make you happy funny script
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-09-09 11:06:51 -04:00
Nick Mathewson
bc4ddbf4ac New practracker exceptions for dependency violations in headers
I've done this manually, since I don't want to override the existing
exceptions in this branch.
2019-09-05 16:17:50 -04:00
Nick Mathewson
318de94e49 Fix a bug in practracker's handling of .may_include in headers
I was expecting our filter code to work in a way it didn't.  I
thought that saying that DependencyViolation applied to "*" would
hit all of the files -- but actually, "*" wasn't implemented.  I had
to say "*.c" and "*.h"
2019-09-05 16:16:20 -04:00
teor
5c2941e69f
shellcheck: Add shellcheck to the pre-commit hook
* Move the shellcheck script from the Makefile to its own script file
* Reformat the shellcheck script so it's easier to read and modify
* Call the shellcheck script from the pre-commit hook

Fixes bug 30967; not in any released version of Tor.
2019-09-05 11:15:26 +10:00
David Goulet
6210c75076 Merge branch 'tor-github/pr/1246' 2019-09-04 08:27:36 -04:00
Nick Mathewson
03040903e6 practracker: handle empty files.
Previously practracker would fail on a file with no lines.
2019-09-02 15:40:35 -04:00
Nick Mathewson
3a2964577e practracker: Fix indentation in util.py
This commit only changes whitespace and removes a temporary comment.
2019-09-02 15:40:35 -04:00
Nick Mathewson
651bbe8a0d Practracker: only consider files under "src/" 2019-09-02 15:40:35 -04:00
Nick Mathewson
e3f7e5e65e practracker: make filename terminology uniform
Previously we often referred to "C files" and "H files", which is
more ambiguous than ".c files" and ".h files".
2019-08-29 09:20:27 -04:00
teor
e155598fe3
scripts/git: fix shellcheck issues in git-push-all.sh
Part of 31314.
2019-08-29 23:13:29 +10:00
teor
340ff7f5f8
scripts/git: fix an env var typo in git-merge-forward.sh
Part of 31314.
2019-08-29 22:58:53 +10:00
teor
d0e31b4d1f
scripts/git: Quote shell arguments where possible
Most shell arguments should be quoted to avoid mistakes.

But since all branch names are hard-coded, or supplied by the script user,
we don't need to be too concerned about command injection.

Quoting all shell arguments would take a major refactor.
(Probably using arrays.)

Part of 31314.
2019-08-29 22:53:44 +10:00
teor
664e6a392e
scripts/git: Improve usage documentation for merge-forward and push-all
Part of 31314.
2019-08-29 22:52:21 +10:00
teor
b47b71ad2f
scripts/git: Let git-push-all.sh skip unchanged test branches
Skip test branches that are the same as remote maint/release/master
branches.

Add a TOR_PUSH_SAME and -s argument to git-push-all.sh to change this
default.

Part of 31314.
2019-08-29 22:50:47 +10:00
teor
70387054b9
scripts/git: Make the git push command and args configurable
TOR_GIT_PUSH provides the git push command and default arguments.

Also fix handling of git-push-all.sh script arguments and arguments that
are passed through to $TOR_GIT_PUSH, using a "--" argument as a separator.

Fix on 29879.
2019-08-29 22:50:37 +10:00
teor
15782758c7
scripts/git: Allow git-merge-forward.sh to re-use existing test branches
Add a -u argument to git-merge-forward.sh, so that the script can
re-use existing test branches after a merge failure and fix.

Part of 31314.
2019-08-29 22:47:50 +10:00
teor
667311ebbd
scripts/git: Add test branch support to the git scripts
Add a -t <test-branch-prefix> argument to git-merge-forward.sh and
git-push-all.sh, which makes these scripts create, merge forward, and
push test branches.

Add a -r <remote-name> argument to git-push-all.sh, so the script can
push test branches to a personal remote.

Closes ticket 31314.
2019-08-29 22:47:43 +10:00
teor
c98724b022
scripts/git: Cleanup and fix minor git scripts issues
Fix typos, clean up formatting, rewrite some comments, add headings.

Preparation for 31314.
2019-08-29 22:42:37 +10:00
Nick Mathewson
c710518825 Add integration tests for new practracker features
These tests check our .may_include checking, and our header file
checking.

They do not pass yet: we have a bug in our filtering code.
2019-08-26 12:28:46 -04:00
George Kadianakis
859514d477 Merge branch 'tor-github/pr/1263' 2019-08-26 17:35:34 +03:00
Nick Mathewson
eff95429fd Merge remote-tracking branch 'tor-github/pr/1241' 2019-08-26 10:15:25 -04:00
Nick Mathewson
ca667b9a8a Fix/suppress shellcheck warnings in git-push-all.sh
(I've chosen to suppress some instances rather than 'fix' them,
since the fix would require arrays or major refactoring.)

Fixes bug 31519; bug not in any released Tor.
2019-08-26 09:58:38 -04:00
David Goulet
24bc2cd7b5 Merge branch 'tor-github/pr/1254' 2019-08-26 09:38:24 -04:00
Nick Mathewson
7a45c9c1d2 Merge remote-tracking branch 'tor-github/pr/1215' 2019-08-24 16:30:55 -04:00
Nick Mathewson
2780cbb9cb Merge branch 'ticket30935' into ticket30935_merged 2019-08-22 17:25:35 -04:00
David Goulet
d475d7c2fb Merge branch 'tor-github/pr/1244' 2019-08-22 17:10:22 -04:00
Nick Mathewson
5b3741e05a Document new practracker violation types, and add a practracker readme
Closes ticket 31476.
2019-08-21 10:17:26 -04:00
Nick Mathewson
cc48eff2d3 Merge branch 'ticket31176' into ticket31176_merged 2019-08-21 09:46:20 -04:00
Nick Mathewson
edf5a327c5 Merge branch 'ticket30914' into ticket30914_merged 2019-08-20 13:57:05 -04:00
teor
bdcccb9776
scripts/git: Remove a duplicate practracker call from the pre-push hook
The pre-push hook already calls the pre-commit hook, which calls
practracker.

Also update the script comments to avoid similar issues in future.

Fixes bug 31462; bugfix on 0.4.1.1-alpha.
2019-08-20 12:21:02 +10:00