Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
6478a98c
Commit
6478a98c
authored
Aug 17, 2015
by
Marek Grabowski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12777 from eparis/test-file-to-go-faster
Speed up pre-commit by always passing at least one file to programs
parents
31e115eb
3a2dd105
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
pre-commit
hooks/pre-commit
+7
-3
No files found.
hooks/pre-commit
View file @
6478a98c
...
@@ -40,6 +40,12 @@ echo "${reset}"
...
@@ -40,6 +40,12 @@ echo "${reset}"
echo
-ne
"Checking for files that need boilerplate... "
echo
-ne
"Checking for files that need boilerplate... "
files
=(
$(
git diff
--cached
--name-only
--diff-filter
ACM
)
)
files
=(
$(
git diff
--cached
--name-only
--diff-filter
ACM
)
)
# We always make sure there is one file in the files list. Some tools check
# the whole repo if they get no files, so in fact, this is much faster on
# git commit --amend
if
[[
${#
files
[@]
}
-eq
0
]]
;
then
files+
=(
"README.md"
)
fi
out
=(
$(
hack/boilerplate/boilerplate.py
"
${
files
[@]
}
"
)
)
out
=(
$(
hack/boilerplate/boilerplate.py
"
${
files
[@]
}
"
)
)
if
[[
"
${#
out
}
"
-ne
0
]]
;
then
if
[[
"
${#
out
}
"
-ne
0
]]
;
then
echo
"
${
red
}
ERROR!"
echo
"
${
red
}
ERROR!"
...
@@ -54,10 +60,8 @@ else
...
@@ -54,10 +60,8 @@ else
fi
fi
echo
"
${
reset
}
"
echo
"
${
reset
}
"
allfiles
=(
$(
git diff
--cached
--name-only
--diff-filter
ACM |
grep
-v
-e
"third_party"
-e
"Godeps"
)
)
echo
-ne
"Checking for problems with flag names... "
echo
-ne
"Checking for problems with flag names... "
invalid_flag_lines
=
$(
hack/verify-flags-underscore.py
"
${
all
files
[@]
}
"
)
invalid_flag_lines
=
$(
hack/verify-flags-underscore.py
"
${
files
[@]
}
"
)
if
[[
"
${
invalid_flag_lines
:-}
"
!=
""
]]
;
then
if
[[
"
${
invalid_flag_lines
:-}
"
!=
""
]]
;
then
echo
"
${
red
}
ERROR!"
echo
"
${
red
}
ERROR!"
echo
"There appear to be problems with the following"
echo
"There appear to be problems with the following"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment