Skip to content

Commit

Permalink
ci: add precommit (#59)
Browse files Browse the repository at this point in the history
* ci: add pre-commit workflow and configuration

Signed-off-by: asa-naki <[email protected]>

* feat: add additional pre-commit hooks for markdownlint, shellcheck, shfmt, isort, black, clang-format, and cpplint

Signed-off-by: asa-naki <[email protected]>

* ci: update pre-commit workflow to use pull_request_target and refine configuration

Signed-off-by: asa-naki <[email protected]>

* ci: change pre-commit workflow trigger from pull_request_target to pull_request

Signed-off-by: asa-naki <[email protected]>

* ci: comment out unused pre-commit hooks and add flake8 configuration

Signed-off-by: asa-naki <[email protected]>

* ci: remove unnecessary pull_request types from pre-commit workflow

Signed-off-by: asa-naki <[email protected]>

* ci: comment out token generation and related steps in pre-commit workflow

Signed-off-by: asa-naki <[email protected]>

* fix: comment out git config step in pre-commit workflow

Signed-off-by: asa-naki <[email protected]>

* ci: delete unnecesary exclude setting

Co-authored-by: Yuma Nihei <[email protected]>

* ci: update flake8 configuration to include import order style and additional settings

Signed-off-by: asa-naki <[email protected]>

* ci: update setup.cfg to include isort configuration options

Signed-off-by: asa-naki <[email protected]>

* ci: comment out unnecessary steps in pre-commit workflow and clean up configuration files

Signed-off-by: asa-naki <[email protected]>

* ci: update flake8 configuration to modify extend-ignore list

Signed-off-by: asa-naki <[email protected]>

* ci: update flake8 configuration to modify extend-ignore list formatting

Signed-off-by: asa-naki <[email protected]>

* ci: update flake8 configuration to sort extend-ignore list

Signed-off-by: asa-naki <[email protected]>

* ci: update flake8 configuration to remove duplicate error code from extend-ignore list

Signed-off-by: asa-naki <[email protected]>

---------

Signed-off-by: asa-naki <[email protected]>
Co-authored-by: Yuma Nihei <[email protected]>
  • Loading branch information
asa-naki and yn-mrse authored Nov 20, 2024
1 parent d433ac7 commit 44f8f56
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: pre-commit

on:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:

- name: Check out repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1

- name: Run pre-commit
uses: autowarefoundation/autoware-github-actions/pre-commit@v1
with:
pre-commit-config: .pre-commit-config.yaml
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/tier4/pre-commit-hooks-ros
rev: v0.8.0
hooks:
- id: flake8-ros

exclude: .svg
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
extend-ignore = A001, A002, CNL100, D100, D101, D102, D103, D104, D105, D107, E203, E225, E231, E275, E301, E302, E305, E501, E712, F401, I100, I201, Q000, W291

0 comments on commit 44f8f56

Please sign in to comment.