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

Add AutoCorrect Lint CI. #225

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint

on:
pull_request:
branches: [master]
push:
branches: [master]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: AutoCorrect
uses: huacnlee/autocorrect-action@v2
Comment on lines +9 to +16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation is different from source code, and sometimes it shouldn't strictly adhere to a specific formatting strategy. It requires some flexibility, as mentioned in #226 (comment). We would like to have control over the formatting strategy.

Additionally, as a formatting check tool, it should support excluding certain paths and provide options to either output warnings only or fail the CI when formatting issues are detected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provide options to either output warnings only or fail the CI when formatting issues are detected.

May I ask that what is your action's support level for this feature?

11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ npm run build
npm run serve
```

## Check contents style

Before you commit your changes, you can check the style of the contents by running the following command:

```sh
$ yarn autocorrect --lint
```

And then follow the instructions to fix the style issues.

## Sync Documentation from `apache/eventmesh`

The `npm run fetch` script (`scripts/fetch.ts`) clones the `apache/eventmesh` repository and copies the documentations to `docs` and `i18n/zh/docusaurus-plugin-content-docs`. To update the documentation, please create a pull request in the `apache/eventmesh` repository.
Expand All @@ -38,4 +48,3 @@ npm run fetch

npm run start -- --locale en
```

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@types/react-router-dom": "^5.1.7",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"autocorrect-node": "^2.10.0",
"eslint": "^8.12.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^16.2.0",
Expand Down
Loading