Skip to content

Commit

Permalink
lint: update format-code script
Browse files Browse the repository at this point in the history
Due to openbmc/openbmc-build-scripts@55448ad, format-code scripts are
now required to have a #!.  Add one here.

Format-code scripts are also ran from an arbitrary directory but the
path to the root of the repository is passed as the first argument.
Switch to that directory so `npm` does the right thing.

Signed-off-by: Patrick Williams <[email protected]>
Change-Id: Ic15ef0af7d7ebd224762e9eaba41d3b92ce5e5bd
  • Loading branch information
williamspatrick authored and rfrandse committed Jun 30, 2022
1 parent a330435 commit 1583e8b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion format-code.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# Run GUI Linting and Formatting as part of the CI Build process
#
# This is a short term solution. The long term solution to will be to
Expand All @@ -6,6 +7,13 @@

set -e

# When called from openbmc-build-scripts, the `pwd` could be anywhere, but
# the root of the repo is passed in the first argument. Switch to the repo
# root so npm/git run in the right place.
if [ -n "$1" ]; then
cd "$1"
fi

npm ci
npm run lint
git --no-pager diff --exit-code
git --no-pager diff --exit-code

0 comments on commit 1583e8b

Please sign in to comment.