Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
eic_tools
Spack
Commits
87d0a7c3
Commit
87d0a7c3
authored
8 years ago
by
Adam J. Stewart
Browse files
Options
Downloads
Patches
Plain Diff
Always clean up tmp files, even if killed
parent
09c9786f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
share/spack/qa/run-flake8
+14
-10
14 additions, 10 deletions
share/spack/qa/run-flake8
with
14 additions
and
10 deletions
share/spack/qa/run-flake8
+
14
−
10
View file @
87d0a7c3
...
@@ -25,6 +25,18 @@ changed+=($(git diff --name-only --find-renames -- '*.py'))
...
@@ -25,6 +25,18 @@ changed+=($(git diff --name-only --find-renames -- '*.py'))
# Ensure that each file in the array is unique
# Ensure that each file in the array is unique
changed
=(
$(
printf
'%s\n'
"
${
changed
[@]
}
"
|
sort
-u
)
)
changed
=(
$(
printf
'%s\n'
"
${
changed
[@]
}
"
|
sort
-u
)
)
function
cleanup
{
# Restore original package files after modifying them.
for
file
in
"
${
changed
[@]
}
"
;
do
if
[[
-e
"
${
file
}
.sbak~"
]]
;
then
mv
"
${
file
}
.sbak~"
"
${
file
}
"
fi
done
}
# Cleanup temporary files upon exit or when script is killed
trap
cleanup EXIT SIGINT SIGTERM
# Add approved style exemptions to the changed packages.
# Add approved style exemptions to the changed packages.
for
file
in
"
${
changed
[@]
}
"
;
do
for
file
in
"
${
changed
[@]
}
"
;
do
# Make a backup to restore later
# Make a backup to restore later
...
@@ -52,7 +64,6 @@ for file in "${changed[@]}"; do
...
@@ -52,7 +64,6 @@ for file in "${changed[@]}"; do
perl
-i
-pe
's/^(.*(https?|file)\:.*)$/\1 # NOQA: ignore=E501/'
$file
perl
-i
-pe
's/^(.*(https?|file)\:.*)$/\1 # NOQA: ignore=E501/'
$file
done
done
return_code
=
0
if
[[
"
${
changed
[@]
}
"
]]
;
then
if
[[
"
${
changed
[@]
}
"
]]
;
then
echo
=======================================================
echo
=======================================================
echo
flake8: running flake8 code checks on spack.
echo
flake8: running flake8 code checks on spack.
...
@@ -64,17 +75,10 @@ if [[ "${changed[@]}" ]]; then
...
@@ -64,17 +75,10 @@ if [[ "${changed[@]}" ]]; then
echo
"Flake8 checks were clean."
echo
"Flake8 checks were clean."
else
else
echo
"Flake8 found errors."
echo
"Flake8 found errors."
return_code
=
1
exit
1
fi
fi
else
else
echo
No core framework files modified.
echo
No core framework files modified.
fi
fi
# Restore original package files after modifying them.
exit
0
for
file
in
"
${
changed
[@]
}
"
;
do
if
[[
-e
"
${
file
}
.sbak~"
]]
;
then
mv
"
${
file
}
.sbak~"
"
${
file
}
"
fi
done
exit
$return_code
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