Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add better linting targets and CI #215

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/a-h/templ v0.2.778 // indirect
github.com/a8m/envsubst v1.4.2 // indirect
github.com/acorn-io/broadcaster v0.0.0-20240105011354-bfadd4a7b45d // indirect
github.com/alecthomas/chroma/v2 v2.8.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63n
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78=
github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/a-h/templ v0.2.778 h1:VzhOuvWECrwOec4790lcLlZpP4Iptt5Q4K9aFxQmtaM=
github.com/a-h/templ v0.2.778/go.mod h1:lq48JXoUvuQrU0VThrK31yFwdRjTCnIE5bcPCM9IP1w=
github.com/a8m/envsubst v1.4.2 h1:4yWIHXOLEJHQEFd4UjrWDrYeYlV7ncFWJOCBRLOZHQg=
github.com/a8m/envsubst v1.4.2/go.mod h1:MVUTQNGQ3tsjOOtKCNd+fl8RzhsXcDvvAEzkhGtlsbY=
github.com/acorn-io/baaah v0.0.0-20240912163758-8f7c537609d1 h1:JobENeM/SoGMlR1/K6DCirRRwBA90FRlynqqqYchOXQ=
Expand Down