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
92db54cc
Unverified
Commit
92db54cc
authored
Feb 07, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 07, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #73335 from oomichi/cleanup-hack
Add check-file-in-alphabetical-order for cleanup
parents
2fd8f8ae
c32d1acb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
20 deletions
+21
-20
util.sh
hack/lib/util.sh
+17
-0
verify-golint.sh
hack/verify-golint.sh
+2
-10
verify-shellcheck.sh
hack/verify-shellcheck.sh
+2
-10
No files found.
hack/lib/util.sh
View file @
92db54cc
...
@@ -775,6 +775,23 @@ function kube::util::ensure-gnu-sed {
...
@@ -775,6 +775,23 @@ function kube::util::ensure-gnu-sed {
fi
fi
}
}
# kube::util::check-file-in-alphabetical-order <file>
# Check that the file is in alphabetical order
#
function
kube::util::check-file-in-alphabetical-order
{
local
failure_file
=
"
$1
"
if
!
diff
-u
"
${
failure_file
}
"
<
(
LC_ALL
=
C
sort
"
${
failure_file
}
"
)
;
then
{
echo
echo
"
${
failure_file
}
is not in alphabetical order. Please sort it:"
echo
echo
" LC_ALL=C sort -o
${
failure_file
}
${
failure_file
}
"
echo
}
>
&2
false
fi
}
# Some useful colors.
# Some useful colors.
if
[[
-z
"
${
color_start
-
}
"
]]
;
then
if
[[
-z
"
${
color_start
-
}
"
]]
;
then
declare
-r
color_start
=
"
\0
33["
declare
-r
color_start
=
"
\0
33["
...
...
hack/verify-golint.sh
View file @
92db54cc
...
@@ -20,6 +20,7 @@ set -o pipefail
...
@@ -20,6 +20,7 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/util.sh"
kube::golang::verify_go_version
kube::golang::verify_go_version
...
@@ -49,16 +50,7 @@ array_contains () {
...
@@ -49,16 +50,7 @@ array_contains () {
# Check that the file is in alphabetical order
# Check that the file is in alphabetical order
failure_file
=
"
${
KUBE_ROOT
}
/hack/.golint_failures"
failure_file
=
"
${
KUBE_ROOT
}
/hack/.golint_failures"
if
!
diff
-u
"
${
failure_file
}
"
<
(
LC_ALL
=
C
sort
"
${
failure_file
}
"
)
;
then
kube::util::check-file-in-alphabetical-order
"
${
failure_file
}
"
{
echo
echo
"hack/.golint_failures is not in alphabetical order. Please sort it:"
echo
echo
" LC_ALL=C sort -o hack/.golint_failures hack/.golint_failures"
echo
}
>
&2
false
fi
export
IFS
=
$'
\n
'
export
IFS
=
$'
\n
'
# NOTE: when "go list -e ./..." is run within GOPATH, it turns the k8s.io/kubernetes
# NOTE: when "go list -e ./..." is run within GOPATH, it turns the k8s.io/kubernetes
...
...
hack/verify-shellcheck.sh
View file @
92db54cc
...
@@ -20,6 +20,7 @@ set -o pipefail
...
@@ -20,6 +20,7 @@ set -o pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
/..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
/..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/util.sh"
# required version for this script, if not installed on the host we will
# required version for this script, if not installed on the host we will
# use the official docker image instead. keep this in sync with SHELLCHECK_IMAGE
# use the official docker image instead. keep this in sync with SHELLCHECK_IMAGE
...
@@ -79,16 +80,7 @@ done < <(find . -name "*.sh" \
...
@@ -79,16 +80,7 @@ done < <(find . -name "*.sh" \
# make sure known failures are sorted
# make sure known failures are sorted
failure_file
=
"
${
KUBE_ROOT
}
/hack/.shellcheck_failures"
failure_file
=
"
${
KUBE_ROOT
}
/hack/.shellcheck_failures"
if
!
diff
-u
"
${
failure_file
}
"
<
(
LC_ALL
=
C
sort
"
${
failure_file
}
"
)
;
then
kube::util::check-file-in-alphabetical-order
"
${
failure_file
}
"
{
echo
echo
"hack/.shellcheck_failures is not in alphabetical order. Please sort it:"
echo
echo
" LC_ALL=C sort -o hack/.shellcheck_failures hack/.shellcheck_failures"
echo
}
>
&2
false
fi
# load known failure files
# load known failure files
failing_files
=()
failing_files
=()
...
...
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