diff --git a/share/spack/qa/run-flake8 b/share/spack/qa/run-flake8
index 2c01800ee95669396741d79f216fb1eecae07190..2b758b7051e71b02b4f728bcea1982b8a96d9329 100755
--- a/share/spack/qa/run-flake8
+++ b/share/spack/qa/run-flake8
@@ -2,11 +2,6 @@
 #
 # This script runs source code style checks on Spack.
 #
-# It should be executed from the top-level directory of the repo,
-# e.g.:
-#
-#    share/spack/qa/run-flake8
-#
 # To run it, you'll need to have the Python flake8 installed locally.
 #
 PYTHONPATH=./lib/spack:$PYTHONPATH
@@ -17,6 +12,9 @@ if [[ ! $flake8 ]]; then
     exit 1
 fi
 
+# Move to Spack root; allows script to be run from anywhere
+cd "$(dirname "$0")/../../.."
+
 # Add changed files that have been committed since branching off of develop
 changed=($(git diff --name-only --find-renames develop... -- '*.py'))
 # Add changed files that have been staged but not yet committed