Skip to content

Commit

Permalink
Merge #412
Browse files Browse the repository at this point in the history
412: Add pre-commit configuration and workflow r=samueltardieu a=samueltardieu



Co-authored-by: Samuel Tardieu <[email protected]>
  • Loading branch information
bors[bot] and samueltardieu authored Jan 28, 2023
2 parents bf47aea + 126fea6 commit f826a11
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
status = [
"Check", "cargo deny", "Rustfmt", "Clippy", "Test with minimal versions",
"Check", "cargo deny", "pre-commit", "Rustfmt", "Clippy", "Test with minimal versions",
"Test suite (stable)", "Test suite (beta)", "Test suite (nightly)", "Test suite (1.65.0)"
]
delete_merged_branches = true
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [staging, trying]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- uses: pre-commit/[email protected]
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
default_language_version:
python: python3 # Defaults to python2, so override it.

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: forbid-submodules
- id: mixed-line-ending
args: ['--fix=lf']
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
args: ['--ignore-words-list', 'crate']
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ before implementing a new feature, in case it is a work in progress already or i
repository.

In order to pass the continuous integration tests, your code must be formatted using the latest
`rustfmt` with the nightly rust toolchain (available as the `rustfmt-preview` component of `rustup`).
`rustfmt` with the nightly rust toolchain, and pass `cargo clippy` and [`pre-commit`](https://pre-commit.com/) checks. Those will run automatically when you submit a pull request.

This repository use the imperative mode in commit messages, such as "Add IDDFS",
"Fix #xxx". This style is preferred over "Added IDDFS" or "Fixed #xxx".
Expand Down

0 comments on commit f826a11

Please sign in to comment.