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
81461f72
Commit
81461f72
authored
Jan 23, 2017
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hack/verify-golint: enforce cleanup of old packages
parent
d0eb7f88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
verify-golint.sh
hack/verify-golint.sh
+26
-9
No files found.
hack/verify-golint.sh
View file @
81461f72
...
...
@@ -76,6 +76,12 @@ for p in "${all_packages[@]}"; do
fi
done
# Check that all linted_packages actually still exist
gone
=()
for
p
in
"
${
linted_packages
[@]
}
"
;
do
array_contains
"
$p
"
"
${
all_packages
[@]
}
"
||
gone+
=(
"
$p
"
)
done
# Check to be sure all the packages that should pass lint are.
if
[
${#
errors
[@]
}
-eq
0
]
;
then
echo
'Congratulations! All Go source files have been linted.'
...
...
@@ -94,18 +100,29 @@ fi
# check to make sure all packages that pass lint are in the linted file.
echo
if
[
${#
linted
[@]
}
-eq
0
]
;
then
if
[
${#
linted
[@]
}
-eq
0
-a
${#
gone
[@]
}
-eq
0
]
;
then
echo
'Success! All packages that should pass lint are listed in the linted file.'
else
{
echo
"Some packages passed golint but are not listed in hack/.linted_packages."
echo
"Please add them in alphabetical order:"
echo
for
p
in
"
${
linted
[@]
}
"
;
do
echo
" echo
$p
>> hack/.linted_packages"
done
echo
" LC_ALL=C sort -o hack/.linted_packages hack/.linted_packages"
echo
if
[
${#
gone
[@]
}
-gt
0
]
;
then
echo
"Some packages in hack/.linted_packages do not exist anymore. Please remove them"
echo
"from hack/.linted_packages:"
echo
for
p
in
"
${
gone
[@]
}
"
;
do
echo
"
$p
"
done
echo
fi
if
[
${#
linted
[@]
}
-gt
0
]
;
then
echo
"Some packages passed golint but are not listed in hack/.linted_packages."
echo
"Please add them in alphabetical order:"
echo
for
p
in
"
${
linted
[@]
}
"
;
do
echo
" echo
$p
>> hack/.linted_packages"
done
echo
" LC_ALL=C sort -o hack/.linted_packages hack/.linted_packages"
echo
fi
echo
'You can test via this script and commit the result.'
echo
}
>
&2
...
...
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