Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 20 additions & 2 deletions .github/workflows/cli-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,37 @@ on:
- 'src/datamodel_code_generator/arguments.py'
- 'src/datamodel_code_generator/cli_options.py'
- 'scripts/build_cli_docs.py'
pull_request_target:
types: [labeled]
paths:
- 'tests/main/**'
- 'tests/test_main_kr.py'
- 'src/datamodel_code_generator/arguments.py'
- 'src/datamodel_code_generator/cli_options.py'
- 'scripts/build_cli_docs.py'

permissions:
contents: write

jobs:
update-cli-docs:
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
if: |
github.event_name == 'push' ||
!github.event.pull_request.head.repo.fork ||
github.actor == 'koxudaxi' ||
github.actor == 'gaborbernat' ||
github.actor == 'ilovelinux' ||
(github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-fix' &&
(github.event.sender.login == 'koxudaxi' ||
github.event.sender.login == 'gaborbernat' ||
github.event.sender.login == 'ilovelinux'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref || github.ref }}
ref: ${{ github.event.pull_request.head.ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
token: ${{ secrets.PAT }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lint
on:
push:
branches: [main]
pull_request:
pull_request_target:
types: [labeled]

jobs:
lint:
if: |
github.event_name == 'push' ||
github.event_name == 'pull_request' ||
(github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-fix' &&
(github.event.sender.login == 'koxudaxi' ||
github.event.sender.login == 'gaborbernat' ||
github.event.sender.login == 'ilovelinux'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT || github.token }}
ref: ${{ github.event.pull_request.head.ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
- uses: astral-sh/setup-uv@v5
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- run: uvx prek run --all-files --show-diff-on-failure --skip readme
- if: |
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository ||
github.actor == 'koxudaxi' ||
github.actor == 'gaborbernat' ||
github.actor == 'ilovelinux' ||
(github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-fix' &&
(github.event.sender.login == 'koxudaxi' ||
github.event.sender.login == 'gaborbernat' ||
github.event.sender.login == 'ilovelinux'))
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: auto-fix by prek"
18 changes: 16 additions & 2 deletions .github/workflows/readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,33 @@ on:
branches: [main]
paths:
- 'src/datamodel_code_generator/**'
pull_request_target:
types: [labeled]
paths:
- 'src/datamodel_code_generator/**'

permissions:
contents: write

jobs:
update-readme:
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
if: |
github.event_name == 'push' ||
!github.event.pull_request.head.repo.fork ||
github.actor == 'koxudaxi' ||
github.actor == 'gaborbernat' ||
github.actor == 'ilovelinux' ||
(github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-fix' &&
(github.event.sender.login == 'koxudaxi' ||
github.event.sender.login == 'gaborbernat' ||
github.event.sender.login == 'ilovelinux'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref || github.ref }}
ref: ${{ github.event.pull_request.head.ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
token: ${{ secrets.PAT }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
Expand Down
3 changes: 0 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
ci:
skip: [readme]

repos:
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.35.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ isort5 = [ "isort>=5,<6" ]
isort6 = [ "isort>=6,<7" ]
isort7 = [ "isort>=7,<8; python_version>='3.10'" ]
pydantic1 = [ "pydantic<2" ]
fix = [ "pre-commit-uv>=4.1.4" ]
fix = [ "prek>=0.2.22" ]
pkg-meta = [ "check-wheel-contents>=0.6.1", "twine>=6.1", "uv>=0.5.22" ]
coverage = [
"covdefaults>=2.3",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dependency_groups =
[testenv:fix]
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
commands =
pre-commit run --all-files --show-diff-on-failure
prek run --all-files --show-diff-on-failure
dependency_groups = fix

[testenv:readme]
Expand Down
Loading
Loading