Skip to content

Commit

Permalink
add CI linting (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl committed Nov 7, 2023
1 parent 0e32b72 commit 7369b11
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
mypy.ini export-ignore
pyproject.toml export-ignore
tox.ini export-ignore
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff mypy
# Update output format to enable automatic inline annotations.
- name: Run Ruff
run: ruff check --output-format=github .
- name: Run Mypy
run: mypy .
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.tox
.ruff_cache
*.pyc
*.cache
*.sublime-project
Expand Down
2 changes: 1 addition & 1 deletion origami.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def zoom_pane(self, fraction):
fraction_vertical = fraction[1]

fraction_horizontal = min(1, max(0, fraction_horizontal))
fraction_vertical = min(1, max(0, fraction_vertical))
fraction_vertical = min(1, max(0, fraction_vertical))

window = self.window
rows, cols, cells = self.get_layout()
Expand Down
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[tool.ruff]
line-length = 120
indent-width = 4
target-version = "py38"

[tool.ruff.lint]
preview = true
select = ["B", "E", "F", "W"]
fixable = ["ALL"]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "lf"
15 changes: 4 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,10 @@
envlist = py3
skipsdist = True

[pycodestyle]
max-line-length = 120

[flake8]
max-line-length = 120
ignore = W191

[testenv]
deps =
flake8==3.8.3
mypy==0.790
mypy==1.6.1
ruff==0.1.4
commands =
mypy plugin
flake8 plugin tests
mypy .
ruff .

0 comments on commit 7369b11

Please sign in to comment.