Skip to content

Commit

Permalink
Check format by ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
shirayu committed Mar 25, 2024
1 parent dcf0eeb commit 5cbdd72
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
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 ruff 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:
ruff format --respect-gitignore

.PHONY: test_style
test_style:
ruff format --respect-gitignore --check

.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 @@
ruff==0.3.4

0 comments on commit 5cbdd72

Please sign in to comment.