Skip to content

Commit

Permalink
Add isort to project (#2564)
Browse files Browse the repository at this point in the history
isort is a utility to sort Python imports alphabetically, and
automatically separate into sections and by type. This will provide a
consistent import style from contributors. As well, by using a tool, a
contributor doesn't need to think about or anticipate the project's
preferred style, just let the tool handle it.

Run isort GitHub action as part of CI.
  • Loading branch information
jdufresne authored Nov 2, 2022
1 parent 105b630 commit 50106dd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: isort

on:
- push
- pull_request

jobs:
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: isort/[email protected]
2 changes: 1 addition & 1 deletion codespell_lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from ._codespell import main, _script_main # noqa
from ._codespell import _script_main, main # noqa
from ._version import __version__ # noqa
4 changes: 2 additions & 2 deletions codespell_lib/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import os
import os.path as op
import re
from shutil import copyfile
import subprocess
import sys
from shutil import copyfile

import pytest

import codespell_lib as cs_
from codespell_lib._codespell import uri_regex_def, EX_USAGE, EX_OK, EX_DATAERR
from codespell_lib._codespell import EX_DATAERR, EX_OK, EX_USAGE, uri_regex_def


def test_constants():
Expand Down
5 changes: 2 additions & 3 deletions codespell_lib/tests/test_dictionary.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import glob
import os.path as op
import os
import os.path as op
import re
import warnings

import pytest

from codespell_lib._codespell import _builtin_dictionaries
from codespell_lib._codespell import supported_languages
from codespell_lib._codespell import _builtin_dictionaries, supported_languages

spellers = dict()

Expand Down

0 comments on commit 50106dd

Please sign in to comment.