format-code: avoid copying eslint config
There isn't a strong reason to copy the eslint config into the
workspace when we can just reference the `openbmc-build-scripts`
repository from within the workspace, like we did for gitlint.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iad6c05527fb60d906d7b9536f4e7608885d4c59f
diff --git a/run-unit-test-docker.sh b/run-unit-test-docker.sh
index bbf49df..30103f6 100755
--- a/run-unit-test-docker.sh
+++ b/run-unit-test-docker.sh
@@ -38,7 +38,6 @@
UNIT_TEST_PY="unit-test.py"
FORMAT_CODE_SH="format-code.sh"
SPELLINGS_TXT="openbmc-spelling.txt openbmc-spelling-ignore.txt"
-ESLINT_CONFIG="eslint-global-config.json"
DBUS_UNIT_TEST_PY="dbus-unit-test.py"
TEST_ONLY="${TEST_ONLY:-}"
DBUS_SYS_CONFIG_FILE=${dbus_sys_config_file:-"/usr/share/dbus-1/system.conf"}
@@ -87,10 +86,6 @@
"${WORKSPACE}/${f}"
done
-# Copy the eslintconfig file into workspce
-cp "${WORKSPACE}"/${OBMC_BUILD_SCRIPTS}/${CONFIG_DIR}/${ESLINT_CONFIG} \
-"${WORKSPACE}"/${ESLINT_CONFIG}
-
# Configure docker build
cd "${WORKSPACE}"/${OBMC_BUILD_SCRIPTS}
echo "Building docker image with build-unit-test-docker"
@@ -145,5 +140,4 @@
rm "${WORKSPACE}"/${UNIT_TEST_PY}
rm "${WORKSPACE}"/${DBUS_UNIT_TEST_PY}
rm "${WORKSPACE}"/${FORMAT_CODE_SH}
-rm "${WORKSPACE}"/${ESLINT_CONFIG}
diff --git a/scripts/format-code.sh b/scripts/format-code.sh
index a8443e0..d5a9730 100755
--- a/scripts/format-code.sh
+++ b/scripts/format-code.sh
@@ -48,7 +48,7 @@
ESLINT_RC="-c .eslintrc.json"
else
echo "Running the json validator on the repo using the global config"
- ESLINT_RC="--no-eslintrc -c ${WORKSPACE}/eslint-global-config.json"
+ ESLINT_RC="--no-eslintrc -c ${WORKSPACE}/openbmc-build-scripts/config/eslint-global-config.json"
fi
ESLINT_COMMAND="eslint . ${ESLINT_IGNORE} ${ESLINT_RC} \