Skip to content
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

Check format by black #902

Closed
wants to merge 4 commits into from
Closed
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
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<!--
Please format codes by black before pull request.

For example:
$ pip install -r ./requirements_dev.txt
$ make style

To test:
$ make test
-->
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: CI
on:
push:
pull_request:
types:
- opened
- synchronize
- reopened

jobs:
ci:
strategy:
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Create venv
run: |
python3 -m venv .venv

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements_dev.txt') }}

- name: Install dependencies
run: .venv/bin/pip install -r ./requirements_dev.txt

- name: Test
run: |
. .venv/bin/activate
make test
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: all
all:

.PHONY: style
style:
black --exclude venv --exclude .venv .

.PHONY: test_style
test_style:
find . -type d \( -name venv -o -name .venv \) -prune -o -type f -name "*.py" -print | xargs black --diff | diff /dev/null -

.PHONY: test
test: test_style


.DELETE_ON_ERROR:
SHELL=/bin/bash
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
black==23.10.1
Loading