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
4b38912a
Commit
4b38912a
authored
Aug 22, 2016
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check sorting of linted file in hack/verify-golint.sh
parent
4b949093
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
verify-golint.sh
hack/verify-golint.sh
+20
-4
No files found.
hack/verify-golint.sh
View file @
4b38912a
...
@@ -37,11 +37,23 @@ array_contains () {
...
@@ -37,11 +37,23 @@ array_contains () {
return
$in
return
$in
}
}
# Check that the file is in alphabetical order
linted_file
=
"
${
KUBE_ROOT
}
/hack/.linted_packages"
if
!
diff
-u
"
${
linted_file
}
"
<
(
LANG
=
C
sort
"
${
linted_file
}
"
)
;
then
{
echo
echo
"hack/.linted_packages is not in alphabetical order. Please sort it:"
echo
echo
" sort -o hack/.linted_packages hack/.linted_packages"
echo
}
>
&2
false
fi
export
IFS
=
$'
\n
'
export
IFS
=
$'
\n
'
all_packages
=(
all_packages
=(
$(
go list
-e
./... | egrep
-v
"/(third_party|vendor|staging|generated|clientset_generated)"
|
sed
's/k8s.io\/kubernetes\///g'
)
$(
go list
-e
./... | egrep
-v
"/(third_party|vendor|staging|generated|clientset_generated)"
|
sed
's/k8s.io\/kubernetes\///g'
)
)
)
linted_file
=
"
${
KUBE_ROOT
}
/hack/.linted_packages"
linted_packages
=(
linted_packages
=(
$(
cat
$linted_file
)
$(
cat
$linted_file
)
)
)
...
@@ -78,16 +90,20 @@ else
...
@@ -78,16 +90,20 @@ else
fi
fi
# check to make sure all packages that pass lint are in the linted file.
# check to make sure all packages that pass lint are in the linted file.
echo
if
[
${#
linted
[@]
}
-eq
0
]
;
then
if
[
${#
linted
[@]
}
-eq
0
]
;
then
echo
'Success! All packages that should pass lint are listed in the linted file.'
echo
'Success! All packages that should pass lint are listed in the linted file.'
else
else
{
{
echo
"The following packages passed golint but are not listed in
$linted_file
:"
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
for
p
in
"
${
linted
[@]
}
"
;
do
echo
"echo
$p
>> hack/.linted_packages"
echo
"
echo
$p
>> hack/.linted_packages"
done
done
echo
" LANG=C sort -o hack/.linted_packages hack/.linted_packages"
echo
echo
echo
'
Please add the following packages to the linted file.
You can test via this script and commit the result.'
echo
'You can test via this script and commit the result.'
echo
echo
}
>
&2
}
>
&2
false
false
...
...
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