Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add pre commit integration #216

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

Merged
Lee-W merged 5 commits into master from add-pre-commit-integration
Jul 4, 2020
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
2 changes: 1 addition & 1 deletion .codacy.yaml
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
exclude_paths:
- 'tests/**'
- 'docs/**'
- 'docs/**'
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Please put an `x` in the box that applies

## Checklist:
- [ ] Add test cases to all the changes you introduce
- [ ] Run `./script/lint` and `./script/test` locally to ensure this change passes linter check and test
- [ ] Run `./script/reformat` and `./script/test` locally to ensure this change passes linter check and test
- [ ] Test the changes on the local machine manually
- [ ] Update the documentation for the changes

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pythonpublish.yaml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ jobs:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
./scripts/publish

33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
default_stages: [push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: check-vcs-permalinks
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: debug-statements
- id: no-commit-to-branch

- repo: https://github.com/Woile/commitizen
rev: v1.23.0
hooks:
- id: commitizen
stages: [commit-msg]

- repo: local
hooks:
- id: reformat
name: reformat
language: system
pass_filenames: false
entry: ./scripts/reformat
types: [python]

- id: linter and test
name: linter and test
language: system
pass_filenames: false
entry: ./scripts/test
types: [python]
2 changes: 1 addition & 1 deletion LICENSE
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ information and is contained within parenthesis, e.g., feat(parser): add ability

[optional body]

[optional footer]
[optional footer]
2 changes: 2 additions & 0 deletions docs/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ cz c
### Integrating with Pre-commit
Commitizen can lint your commit message for you with `cz check`.
You can integrate this in your [pre-commit](https://pre-commit.com/) config with:

```yaml
---
repos:
Expand All @@ -86,6 +87,7 @@ repos:
- id: commitizen
stages: [commit-msg]
```

Read more about the `check` command [here](https://commitizen-tools.github.io/commitizen/check/).

### Help
Expand Down
13 changes: 7 additions & 6 deletions docs/contributing.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ If you're a first-time contributor, you can check the issues with [good first is
1. Fork [the repository](https://github.com/commitizen-tools/commitizen).
2. Clone the repository from your GitHub.
3. Setup development environment through [poetry](https://python-poetry.org/) (`poetry install`).
4. Check out a new branch and add your modification.
5. Add test cases for all your changes.
4. Setup [pre-commit](https://pre-commit.com/) hook (`pre-commit install -t pre-commit -t pre-push -t commit-msg`)
5. Check out a new branch and add your modification.
6. Add test cases for all your changes.
(We use [CodeCov](https://codecov.io/) to ensure our test coverage does not drop.)
6. Use [commitizen](https://github.com/commitizen-tools/commitizen) to do git commit.
7. Run `./scripts/lint` and `./scripts/test` to ensure you follow the coding style and the tests pass.
8. Update `READMD.md` and `CHANGELOG.md` for your changes.
9. Send a [pull request](https://github.com/commitizen-tools/commitizen/pulls) 🙏
7. Use [commitizen](https://github.com/commitizen-tools/commitizen) to do git commit.
8. Run `./scripts/reformat` and `./scripts/test` to ensure you follow the coding style and the tests pass.
9. Update `READMD.md` and `CHANGELOG.md` for your changes.
10. Send a [pull request](https://github.com/commitizen-tools/commitizen/pulls) 🙏
1 change: 0 additions & 1 deletion pyproject.toml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,3 @@ line_length = 88
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

File renamed without changes.

AltStyle によって変換されたページ (->オリジナル) /