Skip to content

Commit

Permalink
Merge pull request #144 from CS3219-AY2425S1/add-checkstyle
Browse files Browse the repository at this point in the history
Add checkstyle based on yarn prettier:fix
  • Loading branch information
SelwynAng authored Sep 26, 2024
2 parents e9c1c30 + 964bee2 commit fe18a50
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 29 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/frontend-pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PR Checks

on:
pull_request:

jobs:
frontend-checks:
runs-on: ubuntu-latest
strategy:
matrix:
check: ['style', 'build']

steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: yarn install
working-directory: ./frontend

- name: Run ESLint
if: matrix.check == 'style'
run: yarn lint
working-directory: ./frontend

- name: Run Prettier check
if: matrix.check == 'style'
run: yarn prettier --check .
working-directory: ./frontend

- name: Build
if: matrix.check == 'build'
run: yarn build
working-directory: ./frontend
24 changes: 0 additions & 24 deletions .github/workflows/pr-build-check.yml

This file was deleted.

8 changes: 3 additions & 5 deletions frontend/components/questions/questions-listing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function QuestionListing() {
</Button>
</div>
);
}
};

const handleFileSelect = (event: ChangeEvent<HTMLInputElement>) => {
const file = event.target.files?.[0];
Expand Down Expand Up @@ -213,9 +213,7 @@ export default function QuestionListing() {
</Button>
</label>
</div>
<div>
{createNewQuestion()}
</div>
<div>{createNewQuestion()}</div>
</div>
)}
<QuestionTable
Expand All @@ -232,4 +230,4 @@ export default function QuestionListing() {
/>
</div>
);
}
}

0 comments on commit fe18a50

Please sign in to comment.