Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
orbea
Tor
Commits
99fffc6c
Commit
99fffc6c
authored
6 years ago
by
rl1987
Committed by
Nick Mathewson
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add a pre-commit hook that runs code and changelog entry formatting checks
parent
aaef95ad
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/feature28976
+4
-0
4 additions, 0 deletions
changes/feature28976
scripts/maint/pre-commit.git-hook
+23
-0
23 additions, 0 deletions
scripts/maint/pre-commit.git-hook
with
27 additions
and
0 deletions
changes/feature28976
0 → 100644
+
4
−
0
View file @
99fffc6c
o Minor features (developer tooling):
- Provide a git pre-commit hook that disallows commiting if we have any
failures in our code and changelog formatting checks. It is now available
in scripts/maint/pre-commit.git-hook. Implements feature 28976.
This diff is collapsed.
Click to expand it.
scripts/maint/pre-commit.git-hook
0 → 100755
+
23
−
0
View file @
99fffc6c
#!/bin/bash
#
# To install this script, copy it to .git/hooks/pre-commit in local copy of
# tor git repo and make sure it has permission to execute.
#
# This is pre-commit git hook script that prevents commiting your changeset if
# it fails our code formatting or changelog entry formatting checkers.
workdir
=
$(
git rev-parse
--show-toplevel
)
cd
"
$workdir
"
||
exit
1
python scripts/maint/lintChanges.py ./changes
perl scripts/maint/checkSpace.pl
-C
\
src/lib/
*
/
*
.[ch]
\
src/core/
*
/
*
.[ch]
\
src/feature/
*
/
*
.[ch]
\
src/app/
*
/
*
.[ch]
\
src/test/
*
.[ch]
\
src/test/
*
/
*
.[ch]
\
src/tools/
*
.[ch]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment