Skip to content

Commit

Permalink
ci: stop enforcing conventional commits
Browse files Browse the repository at this point in the history
Instead, we use a less restrictive check based on a few simple rules:

- number of commits,
- number of words in each commit,
- forbidden words.
  • Loading branch information
dacorvo committed Sep 2, 2024
1 parent 9d50ea5 commit f35ab02
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 44 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/check-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check Commits

on: [workflow_call]

jobs:
build:
name: Check commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: huggingface/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
max-commits: "10"
min-words: "3"
forbidden-words: "fixup"
15 changes: 0 additions & 15 deletions .github/workflows/conventional-commits.yml

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/linux-cpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ on:
- "pyproject.toml"

jobs:
conventional-commits:
uses: ./.github/workflows/conventional-commits.yml
check-commits:
uses: ./.github/workflows/check-commits.yml
python-quality:
uses: ./.github/workflows/python-quality.yml
test-ubuntu-cpu:
needs: [conventional-commits, python-quality]
needs: [check-commits, python-quality]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
python -m pytest test/cli
run_staging_tests:
needs: [conventional-commits, python-quality]
needs: [check-commits, python-quality]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -69,7 +69,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Build and install quanto
run: |
pip install --upgrade pip
Expand All @@ -78,4 +78,4 @@ jobs:
- name: Run models hub tests
run: |
pip install accelerate transformers diffusers
HUGGINGFACE_CO_STAGING=true python -m pytest test/models -k "hub"
HUGGINGFACE_CO_STAGING=true python -m pytest test/models -k "hub"
6 changes: 3 additions & 3 deletions .github/workflows/linux-cuda-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ on:
- "pyproject.toml"

jobs:
conventional-commits:
uses: ./.github/workflows/conventional-commits.yml
check-commits:
uses: ./.github/workflows/check-commits.yml
python-quality:
uses: ./.github/workflows/python-quality.yml
test-ubuntu-cuda:
needs: [conventional-commits, python-quality]
needs: [check-commits, python-quality]
runs-on: [self-hosted, single-gpu , nvidia-gpu, a10, ci]
strategy:
fail-fast: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ on:
- "pyproject.toml"

jobs:
conventional-commits:
uses: ./.github/workflows/conventional-commits.yml
check-commits:
uses: ./.github/workflows/check-commits.yml
python-quality:
uses: ./.github/workflows/python-quality.yml
run-examples:
needs: [conventional-commits, python-quality]
needs: [check-commits, python-quality]
runs-on: [self-hosted, single-gpu , nvidia-gpu, a10, ci]
strategy:
fail-fast: false
Expand Down
26 changes: 9 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,24 +151,16 @@ You'll need **Python 3.8** or above to contribute. Follow the steps below to sta
git commit
```

We kindly request you to use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary)
to clearly communicate the changes you made (here the full [specification](https://www.conventionalcommits.org/en/v1.0.0/))!
This repository uses a `rebase` strategy when merging pull-requests, meaning that your commits will **not** be squashed automatically.

This article gives a brief [rationale](https://julien.ponge.org/blog/the-power-of-conventional-commits/) of why this will make our life and yours easier.
We therefore request you to keep a tidy queue of commits in your pull-request, clearly communicating the changes you made in each commit.

**This is enforced by the continuous integration, so your pull-request will not be reviewed if your commit queue is not clean.**

The following commit types are allowed:
- feat,
- fix,
- docs,
- style,
- refactor,
- test,
- build,
- perf,
- ci,
- chore,
- revert,
- review.
Although this is not mandatory, we kindly ask you to consider using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary)
(here the full [specification](https://www.conventionalcommits.org/en/v1.0.0/))!

This article gives a brief [rationale](https://julien.ponge.org/blog/the-power-of-conventional-commits/) of why this will make our life and yours easier.

To keep your copy of the code up to date with the original
repository, rebase your branch on `upstream/branch` *before* you open a pull request or if requested by a maintainer:
Expand All @@ -178,7 +170,7 @@ You'll need **Python 3.8** or above to contribute. Follow the steps below to sta
git rebase upstream/main
```

Also, consider editing your commit history to make it more readable for the reviewer (like squashing temporary commits).
Before submitting, cleanup your commit history to make it more readable for the reviewer (like squashing temporary commits and editing commit messages to clearly explain what you changed).

Push your changes to your branch:

Expand Down

0 comments on commit f35ab02

Please sign in to comment.