Skip to content

Commit

Permalink
Add .pre-commit-config.yaml (#37)
Browse files Browse the repository at this point in the history
* Add `.pre-commit-config.yaml`

Signed-off-by: Yu ISHIKAWA <[email protected]>

* Add the license comment

Signed-off-by: Yu ISHIKAWA <[email protected]>

* Pin with v1.6.24

Signed-off-by: Yu ISHIKAWA <[email protected]>

---------

Signed-off-by: Yu ISHIKAWA <[email protected]>
  • Loading branch information
yu-iskw authored Apr 11, 2023
1 parent 4a6b6e7 commit 2de9eba
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-json
- id: check-toml
- id: check-yaml
- id: detect-private-key
- repo: https://github.com/rhysd/actionlint
rev: v1.6.24
hooks:
- id: actionlint
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
hooks:
- id: reorder-python-imports
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
hooks:
- id: setup-cfg-fmt
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Set up an environment
.PHONEY: setup
setup:
setup: setup-python setup-pre-commit

.PHONE: setup-python
setup-python:
bash ./dev/setup.sh

.PHONE: setup-pre-commit
setup-pre-commit:
pre-commit install

# Check all the coding style.
.PHONY: lint
lint: lint-shell lint-python
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ dev = [
"yapf >=0.29.0",
"pyyaml >=5.3",
"pdoc3 >=0.9.2",
"pre-commit >=2.15.0",
]

0 comments on commit 2de9eba

Please sign in to comment.