Skip to content

Commit

Permalink
CI: Add isort check
Browse files Browse the repository at this point in the history
  • Loading branch information
un-def committed Jun 5, 2024
1 parent 8cb664d commit 831945a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ on:

jobs:
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
python-version:
- '2.7'
- '3.12'
steps:
- uses: actions/checkout@v3
- uses: MatteoH2O1999/setup-python@v2
- uses: actions/checkout@v4
- uses: MatteoH2O1999/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
allow-build: info
cache-build: true
- name: Install flake8
- name: Install linters
run: |
pip install --upgrade pip wheel setuptools
pip install flake8
- name: Run flake8
pip install isort flake8
- name: Run linters
run: |
isort -q -c -rc .
flake8
5 changes: 3 additions & 2 deletions hererocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
import textwrap
import zipfile


try:
from urllib2 import urlopen, URLError
from urllib2 import URLError, urlopen
except ImportError:
from urllib.request import urlopen
from urllib.error import URLError
from urllib.request import urlopen

if os.name == "nt":
try:
Expand Down
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[flake8]
ignore = E203,E302,E305,E501

[isort]
lines_after_imports = 2
multi_line_output = 5
include_trailing_comma = true
use_parentheses = true
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import codecs
import os

import setuptools


here = os.path.abspath(os.path.dirname(__file__))
readme = codecs.open(os.path.join(here, "README.rst"), encoding="UTF-8")
long_description = readme.read()
Expand Down

0 comments on commit 831945a

Please sign in to comment.