-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
67 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Lint pushes + PRs | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
js-json-md-yaml-lint: | ||
name: JavaScript + JSON + Markdown + YAML | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run ESLint | ||
run: npx eslint . --cache | ||
|
||
python-lint: | ||
name: Python | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run Ruff | ||
uses: chartboost/ruff-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
#!/bin/bash | ||
|
||
RED="\033[1;31m" ; NC="\033[0m" | ||
# Init UI colors | ||
NC="\033[0m" # no color | ||
BR="\033[1;91m" # bright red | ||
BY="\033[1;33m" # bright yellow | ||
|
||
if npm ls -g eslint &> /dev/null || npm ls eslint &> /dev/null ; then | ||
npm run lint | ||
# Run ESLint for JavaScript + JSON + Markdown + YAML | ||
echo -e "\n${BY}Running ESLint...${NC}" | ||
npx eslint . --cache | ||
|
||
# Run Ruff for Python | ||
echo -e "${BY}Running Ruff...${NC}" | ||
if command -v ruff &> /dev/null ; then | ||
ruff check . | ||
else | ||
PROJECT_ROOT=$( | ||
cd "$(dirname "$0")/.." && # nav to root | ||
[ "$OSTYPE" == "msys" ] && pwd -W || pwd # get absolute path | ||
) | ||
echo -e "\n${RED}Warning: eslint not installed${NC}" | ||
echo -e " To add missing dependencies, run 'npm install' from" | ||
echo -e " $PROJECT_ROOT\n" | ||
echo -e "\n${BR}Warning: Ruff not installed${NC}" | ||
echo -e "To add missing Python dependencies, run 'pip install -r requirements-dev.txt' from" | ||
echo -e "$PROJECT_ROOT\n" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
lint.ignore = [ | ||
"E401", # allow multiple imports on one line | ||
"E402", # allow module level import at top of file | ||
"E701", # allow multiple statements on one line (colon) | ||
"E702", # allow multiple statements on one line (semicolon) | ||
"E722" # allow bare exceptions | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruff>=0.8.0 |