Skip to content

Commit

Permalink
fix license script
Browse files Browse the repository at this point in the history
  • Loading branch information
nkzou committed Feb 2, 2024
1 parent ae690ee commit f50565f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust-version }}
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo build

Expand Down
33 changes: 20 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,35 @@ repos:
hooks:
- id: generate
name: Generate
language: node
language: system
entry: bash -c "./generate.sh"
files: '^(\.generator/.*|\.pre-commit-config\.yaml|Makefile|\tests/scenarios/features/.*)'
pass_filenames: false
- id: lint
name: Lint
entry: cargo clippy
language: system
pass_filenames: false
- id: generator
name: generator
language: python
entry: bash -c "cd .generator && poetry install && poetry run python -m generator ./schemas/v1/openapi.yaml ./schemas/v2/openapi.yaml -o ../src/"
files: "^.generator/(config|schemas/v1|src|poetry.lock|pyproject.toml)"
stages: [manual]
pass_filenames: false
additional_dependencies:
- "poetry"
- id: format
name: Format
language: rust
entry: cargo fmt
pass_filenames: false
stages: [manual]
- id: generator
name: generator
language: python
entry: bash -c "cd .generator && poetry install && poetry run python -m generator ./schemas/v1/openapi.yaml ./schemas/v2/openapi.yaml -o ../src/"
files: "^.generator/(config|schemas/v1|src|poetry.lock|pyproject.toml)"
- id: lint
name: Lint
entry: cargo check
language: system
pass_filenames: false
stages: [manual]
- id: license-check
name: Check license file
entry: bash -c "scripts/license-check.sh"
language: system
stages: ["manual"]
verbose: true
pass_filenames: false
additional_dependencies:
- "poetry"
3 changes: 2 additions & 1 deletion generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ pre_commit_wrapper () {
rm -rf src/* examples/*
pre_commit_wrapper generator
pre_commit_wrapper format
pre_commit_wrapper lint
pre_commit_wrapper lint
pre_commit_wrapper license-check
3 changes: 3 additions & 0 deletions scripts/license-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cargo install --quiet dd-rust-license-tool
dd-rust-license-tool check
exit 0

0 comments on commit f50565f

Please sign in to comment.