Skip to content

Commit

Permalink
Merge pull request #215 from tylerslaton/linter
Browse files Browse the repository at this point in the history
feat: add better linting targets and CI
  • Loading branch information
tylerslaton authored Oct 17, 2024
2 parents f92a905 + 6994d1e commit 4fee5b1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 32 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/admin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: admin

on:
pull_request:
branches:
- main
paths:
- ui/admin/**

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.17.0"

- name: Install dependencies
run: |
cd ui/admin
npm install
- name: Run linter
run: make lint-admin

- name: Verify no changes
run: make no-changes
31 changes: 0 additions & 31 deletions .github/workflows/main.yml

This file was deleted.

18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,20 @@ dev: ui
@echo "Starting dev otto server and admin UI..."
./dev.sh

.PHONY: ui build all clean dev
# Lint the project
lint: lint-admin

lint-admin:
cd ui/admin && \
npm run format && \
npm run lint

no-changes:
@if [ -n "$$(git status --porcelain)" ]; then \
git status --porcelain; \
git --no-pager diff; \
echo "Encountered dirty repo!"; \
exit 1; \
fi

.PHONY: ui build all clean dev lint lint-admin lint-api no-changes fmt tidy

0 comments on commit 4fee5b1

Please sign in to comment.