diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 986f10ee..a40a0003 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,6 +12,8 @@ ### Checklist - [ ] The code change is tested and works locally. - [ ] Tests pass. Your PR cannot be merged unless tests pass +- [ ] The code passes linting via + [isort](https://github.com/timothycrosley/isort) (import sorting) -- `isort` - [ ] There is no commented out code in this PR. - [ ] Have you followed the guidelines in our Contributing document? - [ ] Have you checked to ensure there aren't other open [Pull Requests](../pulls) for the same update/change? diff --git a/.travis.yml b/.travis.yml index 8c4ff73d..37bca675 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,6 +67,11 @@ jobs: script: - black --version - black --check . --verbose --diff + - name: Lint, via Isort + python: 3.8 + script: + - isort --version + - isort --check-only --diff # Python 3.6 Tests - name: Python 3.6 on Linux diff --git a/poetry.lock b/poetry.lock index 65356424..72f21f8a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -168,6 +168,25 @@ zipp = ">=0.5" docs = ["sphinx", "rst.linker"] testing = ["packaging", "importlib-resources"] +[[package]] +category = "dev" +description = "A Python utility / library to sort Python imports." +name = "isort" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "4.3.21" + +[package.dependencies] +[package.dependencies.toml] +optional = true +version = "*" + +[package.extras] +pipfile = ["pipreqs", "requirementslib"] +pyproject = ["toml"] +requirements = ["pipreqs", "pip-api"] +xdg_home = ["appdirs (>=1.4.0)"] + [[package]] category = "main" description = "Low-level, pure Python DBus protocol wrapper." @@ -522,7 +541,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] testing = ["jaraco.itertools", "func-timeout"] [metadata] -content-hash = "17cf8d4cf5a772217160daf312f590901dea4a3f5545d003035f3fb713a70f07" +content-hash = "02dfef7e538fa800bc9cc255eaa776ebe275afb0edb48b404458bf65b152a690" python-versions = ">=3.6.0, <3.9.0" [metadata.files] @@ -623,6 +642,10 @@ importlib-metadata = [ {file = "importlib_metadata-1.6.0-py2.py3-none-any.whl", hash = "sha256:2a688cbaa90e0cc587f1df48bdc97a6eadccdcd9c35fb3f976a09e3b5016d90f"}, {file = "importlib_metadata-1.6.0.tar.gz", hash = "sha256:34513a8a0c4962bc66d35b359558fd8a5e10cd472d37aec5f66858addef32c1e"}, ] +isort = [ + {file = "isort-4.3.21-py2.py3-none-any.whl", hash = "sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"}, + {file = "isort-4.3.21.tar.gz", hash = "sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1"}, +] jeepney = [ {file = "jeepney-0.4.3-py3-none-any.whl", hash = "sha256:d6c6b49683446d2407d2fe3acb7a368a77ff063f9182fe427da15d622adc24cf"}, {file = "jeepney-0.4.3.tar.gz", hash = "sha256:3479b861cc2b6407de5188695fa1a8d57e5072d7059322469b62628869b8e36e"}, diff --git a/pyproject.toml b/pyproject.toml index 20f2c306..92bdee82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,10 +35,19 @@ behave = "^1.2" mkdocs = "^1.0" flake8 = "^3.7" black = {version = "^19.10b0",allow-prereleases = true} +isort = {version = "^4.3.21", extras = ["pyproject"]} [tool.poetry.scripts] jrnl = 'jrnl.cli:run' +[tool.isort] +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true +line_length = 88 +known_first_party = "jrnl" + [build-system] requires = ["poetry>=0.12"] build-backend = "poetry.masonry.api"