Skip to content

Commit

Permalink
chore: use autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo committed Dec 9, 2024
1 parent 3c4956e commit feb5c8f
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 247 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: autofix.ci

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:

permissions:
contents: read

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}

jobs:
autofix:
name: Format code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8.6.9

- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install

- name: Format code
run: pnpm format

- name: Run autofix
uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
with:
fail-fast: false
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration
name: integration

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: release

on:
push:
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"lint": "prettier -c --cache . && eslint . --cache --max-warnings=0"
"lint": "eslint . --cache --max-warnings=0",
"format": "prettier -w --cache --ignore-unknown ."
},
"dependencies": {
"@astrojs/starlight": "0.28.3",
Expand Down
12 changes: 2 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
"scripts": {
"test": "pnpm --stream -r test",
"lint": "pnpm -r lint",
"prepare": "husky install"
"format": "pnpm -r format"
},
"devDependencies": {
"@hideoo/eslint-config": "3.0.0",
"@hideoo/prettier-config": "2.0.0",
"@hideoo/tsconfig": "2.0.1",
"astro": "4.16.4",
"eslint": "8.56.0",
"husky": "8.0.3",
"lint-staged": "14.0.1",
"prettier": "3.0.3",
"prettier-plugin-astro": "0.12.0",
"typescript": "5.2.2"
Expand All @@ -40,11 +38,5 @@
"type": "git",
"url": "https://github.com/HiDeoo/starlight-blog.git"
},
"bugs": "https://github.com/HiDeoo/starlight-blog/issues",
"lint-staged": {
"*": [
"prettier -w -u --cache",
"eslint --cache --no-warn-ignored --max-warnings=0"
]
}
"bugs": "https://github.com/HiDeoo/starlight-blog/issues"
}
3 changes: 2 additions & 1 deletion packages/starlight-blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"test": "pnpm test:unit && pnpm test:e2e",
"test:unit": "vitest",
"test:e2e": "playwright install --with-deps chromium && playwright test",
"lint": "prettier -c --cache . && eslint . --cache --max-warnings=0"
"lint": "eslint . --cache --max-warnings=0",
"format": "prettier -w --cache --ignore-unknown ."
},
"dependencies": {
"@astrojs/mdx": "3.1.9",
Expand Down
Loading

0 comments on commit feb5c8f

Please sign in to comment.