diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 8d70e9c4..de043ed8 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -8,7 +8,7 @@ assignees: '' --- Your bug may already be reported! -Please search on the [issue tracker](https://github.com/andreoliwa/flake8-nitpick/issues) before creating one. +Please search on the [issue tracker](https://github.com/andreoliwa/nitpick/issues) before creating one. ## Expected Behavior @@ -41,11 +41,11 @@ Please search on the [issue tracker](https://github.com/andreoliwa/flake8-nitpic -- `flake8-nitpick` version used: +- `nitpick` version used: - Python version: - Operating System and version: - Link to your project: -For more information, see the [CONTRIBUTING](https://github.com/andreoliwa/flake8-nitpick/blob/master/CONTRIBUTING.rst) guide. +For more information, see the [CONTRIBUTING](https://github.com/andreoliwa/nitpick/blob/master/CONTRIBUTING.rst) guide. diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 8f2e5ddc..ee36f03a 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -8,7 +8,7 @@ assignees: '' --- Your feature may already be reported! -Please search on the [issue tracker](https://github.com/andreoliwa/flake8-nitpick/issues) before creating one. +Please search on the [issue tracker](https://github.com/andreoliwa/nitpick/issues) before creating one. ## Expected Behavior @@ -27,6 +27,6 @@ Please search on the [issue tracker](https://github.com/andreoliwa/flake8-nitpic -For more information, see the [CONTRIBUTING](https://github.com/andreoliwa/flake8-nitpick/blob/master/CONTRIBUTING.rst) guide. +For more information, see the [CONTRIBUTING](https://github.com/andreoliwa/nitpick/blob/master/CONTRIBUTING.rst) guide. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62f3647e..b02201fb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,7 +44,7 @@ repos: rev: v2.2.3 hooks: - id: flake8 - additional_dependencies: ['flake8-nitpick', 'flake8-blind-except', 'flake8-bugbear', 'flake8-comprehensions', 'flake8-debugger', 'flake8-docstrings', 'flake8-isort', 'flake8-mypy', 'flake8-polyfill', 'flake8-pytest', 'flake8-quotes', 'yesqa'] + additional_dependencies: ['flake8-blind-except', 'flake8-bugbear', 'flake8-comprehensions', 'flake8-debugger', 'flake8-docstrings', 'flake8-isort', 'flake8-mypy', 'flake8-polyfill', 'flake8-pytest', 'flake8-quotes', 'yesqa'] # FIXME: add nitpick again when it's on PyPI - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.701 hooks: diff --git a/.travis/script.sh b/.travis/script.sh index 31c79ee7..7b262e7d 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -14,4 +14,4 @@ else fi echo "Running coverage report" -coverage run --parallel-mode --source=flake8_nitpick -m pytest +coverage run --parallel-mode --source=nitpick -m pytest diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dfdac8f..887179e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,118 +1,118 @@ -## [0.13.1](https://github.com/andreoliwa/flake8-nitpick/compare/v0.13.0...v0.13.1) (2019-06-07) +## [0.13.1](https://github.com/andreoliwa/nitpick/compare/v0.13.0...v0.13.1) (2019-06-07) ### Bug Fixes -* show warning about project being renamed to "nitpick" ([fda30fd](https://github.com/andreoliwa/flake8-nitpick/commit/fda30fd)) +* show warning about project being renamed to "nitpick" ([fda30fd](https://github.com/andreoliwa/nitpick/commit/fda30fd)) -# [0.13.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.12.0...v0.13.0) (2019-06-06) +# [0.13.0](https://github.com/andreoliwa/nitpick/compare/v0.12.0...v0.13.0) (2019-06-06) ### Features -* run on Python 3.5 ([185e121](https://github.com/andreoliwa/flake8-nitpick/commit/185e121)) +* run on Python 3.5 ([185e121](https://github.com/andreoliwa/nitpick/commit/185e121)) -# [0.12.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.11.0...v0.12.0) (2019-06-03) +# [0.12.0](https://github.com/andreoliwa/nitpick/compare/v0.11.0...v0.12.0) (2019-06-03) ### Features -* get default style file from current version, not from master ([e0dccb8](https://github.com/andreoliwa/flake8-nitpick/commit/e0dccb8)) +* get default style file from current version, not from master ([e0dccb8](https://github.com/andreoliwa/nitpick/commit/e0dccb8)) -# [0.11.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.10.3...v0.11.0) (2019-03-31) +# [0.11.0](https://github.com/andreoliwa/nitpick/compare/v0.10.3...v0.11.0) (2019-03-31) ### Features -* allow pyproject.toml to be located in root dir's parents (thanks [@michael-k](https://github.com/michael-k)) ([#21](https://github.com/andreoliwa/flake8-nitpick/issues/21)) ([d3c4d74](https://github.com/andreoliwa/flake8-nitpick/commit/d3c4d74)) +* allow pyproject.toml to be located in root dir's parents (thanks [@michael-k](https://github.com/michael-k)) ([#21](https://github.com/andreoliwa/nitpick/issues/21)) ([d3c4d74](https://github.com/andreoliwa/nitpick/commit/d3c4d74)) -## [0.10.3](https://github.com/andreoliwa/flake8-nitpick/compare/v0.10.2...v0.10.3) (2019-03-13) +## [0.10.3](https://github.com/andreoliwa/nitpick/compare/v0.10.2...v0.10.3) (2019-03-13) ### Bug Fixes -* ignore FileNotFoundError when removing cache dir ([837bddf](https://github.com/andreoliwa/flake8-nitpick/commit/837bddf)) +* ignore FileNotFoundError when removing cache dir ([837bddf](https://github.com/andreoliwa/nitpick/commit/837bddf)) -## [0.10.2](https://github.com/andreoliwa/flake8-nitpick/compare/v0.10.1...v0.10.2) (2019-03-13) +## [0.10.2](https://github.com/andreoliwa/nitpick/compare/v0.10.1...v0.10.2) (2019-03-13) ### Bug Fixes -* don't remove cache dir if it doesn't exist (FileNotFoundError) ([d5b6ec9](https://github.com/andreoliwa/flake8-nitpick/commit/d5b6ec9)) +* don't remove cache dir if it doesn't exist (FileNotFoundError) ([d5b6ec9](https://github.com/andreoliwa/nitpick/commit/d5b6ec9)) -## [0.10.1](https://github.com/andreoliwa/flake8-nitpick/compare/v0.10.0...v0.10.1) (2019-03-11) +## [0.10.1](https://github.com/andreoliwa/nitpick/compare/v0.10.0...v0.10.1) (2019-03-11) ### Bug Fixes -* fetch private GitHub URLs with a token on the query string ([4cfc118](https://github.com/andreoliwa/flake8-nitpick/commit/4cfc118)) +* fetch private GitHub URLs with a token on the query string ([4cfc118](https://github.com/andreoliwa/nitpick/commit/4cfc118)) -# [0.10.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.9.0...v0.10.0) (2019-03-11) +# [0.10.0](https://github.com/andreoliwa/nitpick/compare/v0.9.0...v0.10.0) (2019-03-11) ### Features -* assume style has a .toml extension when it's missing ([5a584ac](https://github.com/andreoliwa/flake8-nitpick/commit/5a584ac)) -* read local style files from relative and other root dirs ([82d3675](https://github.com/andreoliwa/flake8-nitpick/commit/82d3675)) -* read relative styles in subdirectories of a symlink dir ([55634e1](https://github.com/andreoliwa/flake8-nitpick/commit/55634e1)) -* read styles from relative paths on URLs ([46d1b84](https://github.com/andreoliwa/flake8-nitpick/commit/46d1b84)) +* assume style has a .toml extension when it's missing ([5a584ac](https://github.com/andreoliwa/nitpick/commit/5a584ac)) +* read local style files from relative and other root dirs ([82d3675](https://github.com/andreoliwa/nitpick/commit/82d3675)) +* read relative styles in subdirectories of a symlink dir ([55634e1](https://github.com/andreoliwa/nitpick/commit/55634e1)) +* read styles from relative paths on URLs ([46d1b84](https://github.com/andreoliwa/nitpick/commit/46d1b84)) -# [0.9.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.8.1...v0.9.0) (2019-03-06) +# [0.9.0](https://github.com/andreoliwa/nitpick/compare/v0.8.1...v0.9.0) (2019-03-06) ### Features -* improve error messages ([8a1ea4e](https://github.com/andreoliwa/flake8-nitpick/commit/8a1ea4e)) -* minimum required version on style file ([4090cdc](https://github.com/andreoliwa/flake8-nitpick/commit/4090cdc)) -* one style file can include another (also recursively) ([d963a8d](https://github.com/andreoliwa/flake8-nitpick/commit/d963a8d)) +* improve error messages ([8a1ea4e](https://github.com/andreoliwa/nitpick/commit/8a1ea4e)) +* minimum required version on style file ([4090cdc](https://github.com/andreoliwa/nitpick/commit/4090cdc)) +* one style file can include another (also recursively) ([d963a8d](https://github.com/andreoliwa/nitpick/commit/d963a8d)) -## [0.8.1](https://github.com/andreoliwa/flake8-nitpick/compare/v0.8.0...v0.8.1) (2019-03-04) +## [0.8.1](https://github.com/andreoliwa/nitpick/compare/v0.8.0...v0.8.1) (2019-03-04) ### Bug Fixes -* **setup.cfg:** comma separated values check failing on pre-commit ([27a37b6](https://github.com/andreoliwa/flake8-nitpick/commit/27a37b6)) -* **setup.cfg:** comma separated values still failing on pre-commit, only on the first run ([36ea6f0](https://github.com/andreoliwa/flake8-nitpick/commit/36ea6f0)) +* **setup.cfg:** comma separated values check failing on pre-commit ([27a37b6](https://github.com/andreoliwa/nitpick/commit/27a37b6)) +* **setup.cfg:** comma separated values still failing on pre-commit, only on the first run ([36ea6f0](https://github.com/andreoliwa/nitpick/commit/36ea6f0)) -# [0.8.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.7.1...v0.8.0) (2019-03-04) +# [0.8.0](https://github.com/andreoliwa/nitpick/compare/v0.7.1...v0.8.0) (2019-03-04) ### Bug Fixes -* keep showing other errors when pyproject.toml doesn't exist ([dc7f02f](https://github.com/andreoliwa/flake8-nitpick/commit/dc7f02f)) -* move nitpick config to an exclusive section on the style file ([cd64361](https://github.com/andreoliwa/flake8-nitpick/commit/cd64361)) -* use only yield to return values ([af7d8d2](https://github.com/andreoliwa/flake8-nitpick/commit/af7d8d2)) -* use yaml.safe_load() ([b1df589](https://github.com/andreoliwa/flake8-nitpick/commit/b1df589)) +* keep showing other errors when pyproject.toml doesn't exist ([dc7f02f](https://github.com/andreoliwa/nitpick/commit/dc7f02f)) +* move nitpick config to an exclusive section on the style file ([cd64361](https://github.com/andreoliwa/nitpick/commit/cd64361)) +* use only yield to return values ([af7d8d2](https://github.com/andreoliwa/nitpick/commit/af7d8d2)) +* use yaml.safe_load() ([b1df589](https://github.com/andreoliwa/nitpick/commit/b1df589)) ### Features -* allow configuration of a missing message for each file ([fd053aa](https://github.com/andreoliwa/flake8-nitpick/commit/fd053aa)) -* allow multiple style files ([22505ce](https://github.com/andreoliwa/flake8-nitpick/commit/22505ce)) -* check root keys on pre-commit file (e.g.: fail_fast) ([9470aed](https://github.com/andreoliwa/flake8-nitpick/commit/9470aed)) -* invalidate cache on every run ([e985a0a](https://github.com/andreoliwa/flake8-nitpick/commit/e985a0a)) -* suggest initial contents for missing setup.cfg ([8d33b18](https://github.com/andreoliwa/flake8-nitpick/commit/8d33b18)) -* suggest installing poetry ([5b6038c](https://github.com/andreoliwa/flake8-nitpick/commit/5b6038c)) -* **pre-commit:** suggest pre-commit install ([76b980f](https://github.com/andreoliwa/flake8-nitpick/commit/76b980f)) +* allow configuration of a missing message for each file ([fd053aa](https://github.com/andreoliwa/nitpick/commit/fd053aa)) +* allow multiple style files ([22505ce](https://github.com/andreoliwa/nitpick/commit/22505ce)) +* check root keys on pre-commit file (e.g.: fail_fast) ([9470aed](https://github.com/andreoliwa/nitpick/commit/9470aed)) +* invalidate cache on every run ([e985a0a](https://github.com/andreoliwa/nitpick/commit/e985a0a)) +* suggest initial contents for missing setup.cfg ([8d33b18](https://github.com/andreoliwa/nitpick/commit/8d33b18)) +* suggest installing poetry ([5b6038c](https://github.com/andreoliwa/nitpick/commit/5b6038c)) +* **pre-commit:** suggest pre-commit install ([76b980f](https://github.com/andreoliwa/nitpick/commit/76b980f)) ### BREAKING CHANGES @@ -143,100 +143,100 @@ Now: -## [0.7.1](https://github.com/andreoliwa/flake8-nitpick/compare/v0.7.0...v0.7.1) (2019-02-14) +## [0.7.1](https://github.com/andreoliwa/nitpick/compare/v0.7.0...v0.7.1) (2019-02-14) ### Bug Fixes -* Missing flake8 entry point on pyproject.toml ([a416007](https://github.com/andreoliwa/flake8-nitpick/commit/a416007)) +* Missing flake8 entry point on pyproject.toml ([a416007](https://github.com/andreoliwa/nitpick/commit/a416007)) -# [0.7.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.6.0...v0.7.0) (2019-02-14) +# [0.7.0](https://github.com/andreoliwa/nitpick/compare/v0.6.0...v0.7.0) (2019-02-14) ### Features -* Suggest initial contents for missing .pre-commit-config.yaml ([16a6256](https://github.com/andreoliwa/flake8-nitpick/commit/16a6256)) +* Suggest initial contents for missing .pre-commit-config.yaml ([16a6256](https://github.com/andreoliwa/nitpick/commit/16a6256)) -# [0.6.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.5.0...v0.6.0) (2019-01-28) +# [0.6.0](https://github.com/andreoliwa/nitpick/compare/v0.5.0...v0.6.0) (2019-01-28) ### Features -* Configure comma separated values on the style file ([7ae6622](https://github.com/andreoliwa/flake8-nitpick/commit/7ae6622)) -* Suggest poetry init when pyproject.toml does not exist ([366c2b6](https://github.com/andreoliwa/flake8-nitpick/commit/366c2b6)) +* Configure comma separated values on the style file ([7ae6622](https://github.com/andreoliwa/nitpick/commit/7ae6622)) +* Suggest poetry init when pyproject.toml does not exist ([366c2b6](https://github.com/andreoliwa/nitpick/commit/366c2b6)) ### Bug Fixes -* DeprecationWarning: Using or importing the ABCs from 'collections' in ([80f7e24](https://github.com/andreoliwa/flake8-nitpick/commit/80f7e24)) +* DeprecationWarning: Using or importing the ABCs from 'collections' in ([80f7e24](https://github.com/andreoliwa/nitpick/commit/80f7e24)) -# [0.5.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.4.0...v0.5.0) (2019-01-09) +# [0.5.0](https://github.com/andreoliwa/nitpick/compare/v0.4.0...v0.5.0) (2019-01-09) ### Features -* Add .venv to the absent files list ([153a7ca](https://github.com/andreoliwa/flake8-nitpick/commit/153a7ca)) -* Add flake8-quotes to the default style ([60b3726](https://github.com/andreoliwa/flake8-nitpick/commit/60b3726)) +* Add .venv to the absent files list ([153a7ca](https://github.com/andreoliwa/nitpick/commit/153a7ca)) +* Add flake8-quotes to the default style ([60b3726](https://github.com/andreoliwa/nitpick/commit/60b3726)) -# [0.4.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.3.0...v0.4.0) (2019-01-07) +# [0.4.0](https://github.com/andreoliwa/nitpick/compare/v0.3.0...v0.4.0) (2019-01-07) ### Features -* Check files that should not exist (like .isort.cfg) ([1901bb8](https://github.com/andreoliwa/flake8-nitpick/commit/1901bb8)) -* Check pre-commit config file and the presence of hooks ([b1333db](https://github.com/andreoliwa/flake8-nitpick/commit/b1333db)) -* Warn about replacing requirements.txt by pyproject.toml ([dacb091](https://github.com/andreoliwa/flake8-nitpick/commit/dacb091)) +* Check files that should not exist (like .isort.cfg) ([1901bb8](https://github.com/andreoliwa/nitpick/commit/1901bb8)) +* Check pre-commit config file and the presence of hooks ([b1333db](https://github.com/andreoliwa/nitpick/commit/b1333db)) +* Warn about replacing requirements.txt by pyproject.toml ([dacb091](https://github.com/andreoliwa/nitpick/commit/dacb091)) ### Bug Fixes -* Don't break when pyproject.toml or setup.cfg don't exist ([6a546c1](https://github.com/andreoliwa/flake8-nitpick/commit/6a546c1)) -* Only check rules if the file exists ([66e42d2](https://github.com/andreoliwa/flake8-nitpick/commit/66e42d2)) +* Don't break when pyproject.toml or setup.cfg don't exist ([6a546c1](https://github.com/andreoliwa/nitpick/commit/6a546c1)) +* Only check rules if the file exists ([66e42d2](https://github.com/andreoliwa/nitpick/commit/66e42d2)) -# [0.3.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.2.0...v0.3.0) (2019-01-03) +# [0.3.0](https://github.com/andreoliwa/nitpick/compare/v0.2.0...v0.3.0) (2019-01-03) ### Features -* Show different key/value pairs on pyproject.toml, case insensitive boolean values ([30e03eb](https://github.com/andreoliwa/flake8-nitpick/commit/30e03eb)) +* Show different key/value pairs on pyproject.toml, case insensitive boolean values ([30e03eb](https://github.com/andreoliwa/nitpick/commit/30e03eb)) ### Bug Fixes -* KeyError when section does not exist on setup.cfg ([e652604](https://github.com/andreoliwa/flake8-nitpick/commit/e652604)) +* KeyError when section does not exist on setup.cfg ([e652604](https://github.com/andreoliwa/nitpick/commit/e652604)) -# [0.2.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.1.1...v0.2.0) (2018-12-23) +# [0.2.0](https://github.com/andreoliwa/nitpick/compare/v0.1.1...v0.2.0) (2018-12-23) ### Features -* Check missing key/value pairs in pyproject.toml ([190aa6c](https://github.com/andreoliwa/flake8-nitpick/commit/190aa6c)) -* Compare setup.cfg configuration ([2bf144a](https://github.com/andreoliwa/flake8-nitpick/commit/2bf144a)) -* First warning, only on the main Python file ([0b30506](https://github.com/andreoliwa/flake8-nitpick/commit/0b30506)) -* Read config from pyproject.toml, cache data, run only on one Python ([265daa5](https://github.com/andreoliwa/flake8-nitpick/commit/265daa5)) -* Read style from TOML file/URL (or climb directory tree) ([84f19d6](https://github.com/andreoliwa/flake8-nitpick/commit/84f19d6)) -* Respect the files section on nitpick.toml ([9e36a02](https://github.com/andreoliwa/flake8-nitpick/commit/9e36a02)) -* Use nitpick's own default style file if none is provided ([4701b86](https://github.com/andreoliwa/flake8-nitpick/commit/4701b86)) +* Check missing key/value pairs in pyproject.toml ([190aa6c](https://github.com/andreoliwa/nitpick/commit/190aa6c)) +* Compare setup.cfg configuration ([2bf144a](https://github.com/andreoliwa/nitpick/commit/2bf144a)) +* First warning, only on the main Python file ([0b30506](https://github.com/andreoliwa/nitpick/commit/0b30506)) +* Read config from pyproject.toml, cache data, run only on one Python ([265daa5](https://github.com/andreoliwa/nitpick/commit/265daa5)) +* Read style from TOML file/URL (or climb directory tree) ([84f19d6](https://github.com/andreoliwa/nitpick/commit/84f19d6)) +* Respect the files section on nitpick.toml ([9e36a02](https://github.com/andreoliwa/nitpick/commit/9e36a02)) +* Use nitpick's own default style file if none is provided ([4701b86](https://github.com/andreoliwa/nitpick/commit/4701b86)) -## [0.1.1](https://github.com/andreoliwa/flake8-nitpick/compare/v0.1.0...v0.1.1) (2018-03-23) +## [0.1.1](https://github.com/andreoliwa/nitpick/compare/v0.1.0...v0.1.1) (2018-03-23) README badges. diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 64aa1aa2..b4ef0c4c 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -5,41 +5,41 @@ Contributing Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. -Check the `projects on GitHub `_, you might help coding a planned feature. +Check the `projects on GitHub `_, you might help coding a planned feature. Bug reports or feature requests =============================== -* First, search the `GitHub issue tracker `_ to see if your bug/feature is already there. -* If nothing is found, just `add a new issue and follow the instructions there `_. +* First, search the `GitHub issue tracker `_ to see if your bug/feature is already there. +* If nothing is found, just `add a new issue and follow the instructions there `_. Documentation improvements ========================== -flake8-nitpick could always use more documentation, whether as part of the +nitpick could always use more documentation, whether as part of the official docs, in docstrings, or even on the web in blog posts, articles, and such. Development =========== -To set up ``flake8-nitpick`` for local development: +To set up ``nitpick`` for local development: -1. Fork `flake8-nitpick `_ +1. Fork `nitpick `_ (look for the "Fork" button). 2. Clone your fork locally:: cd ~/Code - git clone git@github.com:your_name_here/flake8-nitpick.git - cd flake8-nitpick + git clone git@github.com:your_name_here/nitpick.git + cd nitpick 3. `Install Poetry globally using the recommended way `_. 4. Create your virtualenv with pyenv (or some other tool you prefer):: - pyenv virtualenv 3.6.8 flake8-nitpick - pyenv activate flake8-nitpick + pyenv virtualenv 3.6.8 nitpick + pyenv activate nitpick 5. Install packages:: @@ -89,6 +89,6 @@ For merging, you should: 3. Add yourself to ``AUTHORS.rst``. .. [1] If you don't have all the necessary python versions available locally you can rely on Travis - it will - `run the tests `_ for each change you add in the pull request. + `run the tests `_ for each change you add in the pull request. It will be slower though ... diff --git a/Makefile b/Makefile index 4f87f3ff..3c64457a 100644 --- a/Makefile +++ b/Makefile @@ -16,5 +16,6 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - sphinx-apidoc -f -o docs/source flake8_nitpick/ + rm -rf docs/source + sphinx-apidoc --force --module-first --separate --implicit-namespaces --output-dir docs/source nitpick/ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/README.md b/README.md index 1aea2379..9c38a5cb 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# flake8-nitpick - -[![PyPI](https://img.shields.io/pypi/v/flake8-nitpick.svg)](https://pypi.python.org/pypi/flake8-nitpick) -[![Travis CI](https://travis-ci.com/andreoliwa/flake8-nitpick.svg?branch=master)](https://travis-ci.com/andreoliwa/flake8-nitpick) -[![Documentation Status](https://readthedocs.org/projects/flake8-nitpick/badge/?version=latest)](https://flake8-nitpick.readthedocs.io/en/latest/?badge=latest) -[![Coveralls](https://coveralls.io/repos/github/andreoliwa/flake8-nitpick/badge.svg?branch=master)](https://coveralls.io/github/andreoliwa/flake8-nitpick?branch=master) -[![Maintainability](https://api.codeclimate.com/v1/badges/901b4b62293cf7f2c4bc/maintainability)](https://codeclimate.com/github/andreoliwa/flake8-nitpick/maintainability) -[![Test Coverage](https://api.codeclimate.com/v1/badges/901b4b62293cf7f2c4bc/test_coverage)](https://codeclimate.com/github/andreoliwa/flake8-nitpick/test_coverage) -[![Supported Python versions](https://img.shields.io/pypi/pyversions/flake8-nitpick.svg)](https://pypi.org/project/flake8-nitpick/) -[![Project License](https://img.shields.io/pypi/l/flake8-nitpick.svg)](https://pypi.org/project/flake8-nitpick/) +# nitpick + +[![PyPI](https://img.shields.io/pypi/v/nitpick.svg)](https://pypi.python.org/pypi/nitpick) +[![Travis CI](https://travis-ci.com/andreoliwa/nitpick.svg?branch=master)](https://travis-ci.com/andreoliwa/nitpick) +[![Documentation Status](https://readthedocs.org/projects/nitpick/badge/?version=latest)](https://nitpick.readthedocs.io/en/latest/?badge=latest) +[![Coveralls](https://coveralls.io/repos/github/andreoliwa/nitpick/badge.svg?branch=master)](https://coveralls.io/github/andreoliwa/nitpick?branch=master) +[![Maintainability](https://api.codeclimate.com/v1/badges/901b4b62293cf7f2c4bc/maintainability)](https://codeclimate.com/github/andreoliwa/nitpick/maintainability) +[![Test Coverage](https://api.codeclimate.com/v1/badges/901b4b62293cf7f2c4bc/test_coverage)](https://codeclimate.com/github/andreoliwa/nitpick/test_coverage) +[![Supported Python versions](https://img.shields.io/pypi/pyversions/nitpick.svg)](https://pypi.org/project/nitpick/) +[![Project License](https://img.shields.io/pypi/l/nitpick.svg)](https://pypi.org/project/nitpick/) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) -[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=andreoliwa/flake8-nitpick)](https://dependabot.com) +[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=andreoliwa/nitpick)](https://dependabot.com) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) Flake8 plugin to enforce the same lint configuration (flake8, isort, mypy, pylint) across multiple Python projects. @@ -32,10 +32,10 @@ A "nitpick code style" is a [TOML](https://github.com/toml-lang/toml) file with Simply install the package (in a virtualenv or globally, wherever) and run `flake8`: - $ pip install -U flake8-nitpick + $ pip install -U nitpick $ flake8 -You will see warnings if your project configuration is different than [the default style file](https://raw.githubusercontent.com/andreoliwa/flake8-nitpick//0.13.1/nitpick-style.toml/nitpick-style.toml). +You will see warnings if your project configuration is different than [the default style file](https://raw.githubusercontent.com/andreoliwa/nitpick//0.13.1/nitpick-style.toml/nitpick-style.toml). ## Style file @@ -44,7 +44,7 @@ You will see warnings if your project configuration is different than [the defau Change your project config on `pyproject.toml`, and configure your own style like this: [tool.nitpick] - style = "https://raw.githubusercontent.com/andreoliwa/flake8-nitpick//0.13.1/nitpick-style.toml/nitpick-style.toml" + style = "https://raw.githubusercontent.com/andreoliwa/nitpick//0.13.1/nitpick-style.toml/nitpick-style.toml" You can set `style` with any local file or URL. E.g.: you can use the raw URL of a [GitHub Gist](https://gist.github.com). @@ -62,7 +62,7 @@ If a key is defined in more than one file, the value from the last file will pre 2. Any `nitpick-style.toml` file found in the current directory (the one in which `flake8` runs from) or above. -3. If no style is found, then [the default style file from GitHub](https://raw.githubusercontent.com/andreoliwa/flake8-nitpick//0.13.1/nitpick-style.toml/nitpick-style.toml) is used. +3. If no style is found, then [the default style file from GitHub](https://raw.githubusercontent.com/andreoliwa/nitpick//0.13.1/nitpick-style.toml/nitpick-style.toml) is used. ### Style file syntax diff --git a/docs/conf.py b/docs/conf.py index c425d498..b59d0af5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,7 +17,7 @@ # sys.path.insert(0, os.path.abspath('.')) # -- Project information ----------------------------------------------------- -project = "flake8-nitpick" +project = "nitpick" copyright = "2019, W. Augusto Andreoli" author = "W. Augusto Andreoli" @@ -119,7 +119,7 @@ # -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. -htmlhelp_basename = "flake8-nitpickdoc" +htmlhelp_basename = "nitpickdoc" # -- Options for LaTeX output ------------------------------------------------ @@ -142,14 +142,14 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). -latex_documents = [(master_doc, "flake8-nitpick.tex", "flake8-nitpick Documentation", "W. Augusto Andreoli", "manual")] +latex_documents = [(master_doc, "nitpick.tex", "nitpick Documentation", "W. Augusto Andreoli", "manual")] # -- Options for manual page output ------------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [(master_doc, "flake8-nitpick", "flake8-nitpick Documentation", [author], 1)] +man_pages = [(master_doc, "nitpick", "nitpick Documentation", [author], 1)] # -- Options for Texinfo output ---------------------------------------------- @@ -160,10 +160,10 @@ texinfo_documents = [ ( master_doc, - "flake8-nitpick", - "flake8-nitpick Documentation", + "nitpick", + "nitpick Documentation", author, - "flake8-nitpick", + "nitpick", "Flake8 plugin to enforce the same lint configuration (flake8, isort, mypy, pylint)" + " across multiple Python projects", "Miscellaneous", @@ -218,4 +218,4 @@ # -- Options for extlinks extension --------------------------------------- # http://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html#confval-extlinks -extlinks = {"issue": ("https://github.com/andreoliwa/flake8-nitpick/issues/%s", "issue ")} +extlinks = {"issue": ("https://github.com/andreoliwa/nitpick/issues/%s", "issue ")} diff --git a/docs/index.rst b/docs/index.rst index 9af559ad..3b3cc029 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ -Welcome to flake8-nitpick's documentation! -========================================== +Welcome to nitpick's documentation! +=================================== .. toctree:: :maxdepth: 2 diff --git a/docs/source/flake8_nitpick.files.rst b/docs/source/flake8_nitpick.files.rst deleted file mode 100644 index b3eacbb3..00000000 --- a/docs/source/flake8_nitpick.files.rst +++ /dev/null @@ -1,46 +0,0 @@ -flake8\_nitpick.files package -============================= - -Submodules ----------- - -flake8\_nitpick.files.base module ---------------------------------- - -.. automodule:: flake8_nitpick.files.base - :members: - :undoc-members: - :show-inheritance: - -flake8\_nitpick.files.pre\_commit module ----------------------------------------- - -.. automodule:: flake8_nitpick.files.pre_commit - :members: - :undoc-members: - :show-inheritance: - -flake8\_nitpick.files.pyproject\_toml module --------------------------------------------- - -.. automodule:: flake8_nitpick.files.pyproject_toml - :members: - :undoc-members: - :show-inheritance: - -flake8\_nitpick.files.setup\_cfg module ---------------------------------------- - -.. automodule:: flake8_nitpick.files.setup_cfg - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: flake8_nitpick.files - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/flake8_nitpick.rst b/docs/source/flake8_nitpick.rst deleted file mode 100644 index 877c1891..00000000 --- a/docs/source/flake8_nitpick.rst +++ /dev/null @@ -1,77 +0,0 @@ -flake8\_nitpick package -======================= - -Subpackages ------------ - -.. toctree:: - - flake8_nitpick.files - -Submodules ----------- - -flake8\_nitpick.config module ------------------------------ - -.. automodule:: flake8_nitpick.config - :members: - :undoc-members: - :show-inheritance: - -flake8\_nitpick.constants module --------------------------------- - -.. automodule:: flake8_nitpick.constants - :members: - :undoc-members: - :show-inheritance: - -flake8\_nitpick.generic module ------------------------------- - -.. automodule:: flake8_nitpick.generic - :members: - :undoc-members: - :show-inheritance: - -flake8\_nitpick.mixin module ----------------------------- - -.. automodule:: flake8_nitpick.mixin - :members: - :undoc-members: - :show-inheritance: - -flake8\_nitpick.plugin module ------------------------------ - -.. automodule:: flake8_nitpick.plugin - :members: - :undoc-members: - :show-inheritance: - -flake8\_nitpick.style module ----------------------------- - -.. automodule:: flake8_nitpick.style - :members: - :undoc-members: - :show-inheritance: - -flake8\_nitpick.types module ----------------------------- - -.. automodule:: flake8_nitpick.types - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: flake8_nitpick - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/modules.rst b/docs/source/modules.rst index 9345a26e..43e2b3f7 100644 --- a/docs/source/modules.rst +++ b/docs/source/modules.rst @@ -1,7 +1,7 @@ -flake8_nitpick -============== +nitpick +======= .. toctree:: :maxdepth: 4 - flake8_nitpick + nitpick diff --git a/docs/source/nitpick.config.rst b/docs/source/nitpick.config.rst new file mode 100644 index 00000000..1c14a2ce --- /dev/null +++ b/docs/source/nitpick.config.rst @@ -0,0 +1,7 @@ +nitpick.config module +===================== + +.. automodule:: nitpick.config + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/nitpick.constants.rst b/docs/source/nitpick.constants.rst new file mode 100644 index 00000000..e8d6e146 --- /dev/null +++ b/docs/source/nitpick.constants.rst @@ -0,0 +1,7 @@ +nitpick.constants module +======================== + +.. automodule:: nitpick.constants + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/nitpick.files.base.rst b/docs/source/nitpick.files.base.rst new file mode 100644 index 00000000..34cd5442 --- /dev/null +++ b/docs/source/nitpick.files.base.rst @@ -0,0 +1,7 @@ +nitpick.files.base module +========================= + +.. automodule:: nitpick.files.base + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/nitpick.files.pre_commit.rst b/docs/source/nitpick.files.pre_commit.rst new file mode 100644 index 00000000..9c16f7ad --- /dev/null +++ b/docs/source/nitpick.files.pre_commit.rst @@ -0,0 +1,7 @@ +nitpick.files.pre\_commit module +================================ + +.. automodule:: nitpick.files.pre_commit + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/nitpick.files.pyproject_toml.rst b/docs/source/nitpick.files.pyproject_toml.rst new file mode 100644 index 00000000..98fb2031 --- /dev/null +++ b/docs/source/nitpick.files.pyproject_toml.rst @@ -0,0 +1,7 @@ +nitpick.files.pyproject\_toml module +==================================== + +.. automodule:: nitpick.files.pyproject_toml + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/nitpick.files.rst b/docs/source/nitpick.files.rst new file mode 100644 index 00000000..73b052e6 --- /dev/null +++ b/docs/source/nitpick.files.rst @@ -0,0 +1,17 @@ +nitpick.files package +===================== + +.. automodule:: nitpick.files + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + + nitpick.files.base + nitpick.files.pre_commit + nitpick.files.pyproject_toml + nitpick.files.setup_cfg diff --git a/docs/source/nitpick.files.setup_cfg.rst b/docs/source/nitpick.files.setup_cfg.rst new file mode 100644 index 00000000..cfb23e0e --- /dev/null +++ b/docs/source/nitpick.files.setup_cfg.rst @@ -0,0 +1,7 @@ +nitpick.files.setup\_cfg module +=============================== + +.. automodule:: nitpick.files.setup_cfg + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/nitpick.generic.rst b/docs/source/nitpick.generic.rst new file mode 100644 index 00000000..fcb0a31b --- /dev/null +++ b/docs/source/nitpick.generic.rst @@ -0,0 +1,7 @@ +nitpick.generic module +====================== + +.. automodule:: nitpick.generic + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/nitpick.mixin.rst b/docs/source/nitpick.mixin.rst new file mode 100644 index 00000000..b87c374f --- /dev/null +++ b/docs/source/nitpick.mixin.rst @@ -0,0 +1,7 @@ +nitpick.mixin module +==================== + +.. automodule:: nitpick.mixin + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/nitpick.plugin.rst b/docs/source/nitpick.plugin.rst new file mode 100644 index 00000000..487c9c55 --- /dev/null +++ b/docs/source/nitpick.plugin.rst @@ -0,0 +1,7 @@ +nitpick.plugin module +===================== + +.. automodule:: nitpick.plugin + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/nitpick.rst b/docs/source/nitpick.rst new file mode 100644 index 00000000..44d3e6a1 --- /dev/null +++ b/docs/source/nitpick.rst @@ -0,0 +1,27 @@ +nitpick package +=============== + +.. automodule:: nitpick + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + + nitpick.files + +Submodules +---------- + +.. toctree:: + + nitpick.config + nitpick.constants + nitpick.generic + nitpick.mixin + nitpick.plugin + nitpick.style + nitpick.typedefs diff --git a/docs/source/nitpick.style.rst b/docs/source/nitpick.style.rst new file mode 100644 index 00000000..b9c95ff1 --- /dev/null +++ b/docs/source/nitpick.style.rst @@ -0,0 +1,7 @@ +nitpick.style module +==================== + +.. automodule:: nitpick.style + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/nitpick.typedefs.rst b/docs/source/nitpick.typedefs.rst new file mode 100644 index 00000000..283fa58f --- /dev/null +++ b/docs/source/nitpick.typedefs.rst @@ -0,0 +1,7 @@ +nitpick.typedefs module +======================= + +.. automodule:: nitpick.typedefs + :members: + :undoc-members: + :show-inheritance: diff --git a/nitpick-style.toml b/nitpick-style.toml index a382b892..74f2bb07 100644 --- a/nitpick-style.toml +++ b/nitpick-style.toml @@ -1,5 +1,5 @@ -# Default style file for flake8-nitpick -# https://raw.githubusercontent.com/andreoliwa/flake8-nitpick/0.13.1/nitpick-style.toml/nitpick-style.toml +# Default style file for nitpick +# https://raw.githubusercontent.com/andreoliwa/nitpick/0.13.1/nitpick-style.toml/nitpick-style.toml [nitpick] minimum_version = "0.10.0" diff --git a/flake8_nitpick/__init__.py b/nitpick/__init__.py similarity index 100% rename from flake8_nitpick/__init__.py rename to nitpick/__init__.py diff --git a/flake8_nitpick/config.py b/nitpick/config.py similarity index 91% rename from flake8_nitpick/config.py rename to nitpick/config.py index cb36e2c9..3617520e 100644 --- a/flake8_nitpick/config.py +++ b/nitpick/config.py @@ -9,7 +9,7 @@ import toml -from flake8_nitpick.constants import ( +from nitpick.constants import ( LOG_ROOT, MANAGE_PY, NITPICK_MINIMUM_VERSION_JMEX, @@ -18,12 +18,12 @@ ROOT_PYTHON_FILES, TOOL_NITPICK_JMEX, ) -from flake8_nitpick.files.pyproject_toml import PyProjectTomlFile -from flake8_nitpick.files.setup_cfg import SetupCfgFile -from flake8_nitpick.generic import climb_directory_tree, rmdir_if_empty, search_dict, version_to_tuple -from flake8_nitpick.mixin import NitpickMixin -from flake8_nitpick.style import Style -from flake8_nitpick.typedefs import JsonDict, PathOrStr, StrOrList, YieldFlake8Error +from nitpick.files.pyproject_toml import PyProjectTomlFile +from nitpick.files.setup_cfg import SetupCfgFile +from nitpick.generic import climb_directory_tree, rmdir_if_empty, search_dict, version_to_tuple +from nitpick.mixin import NitpickMixin +from nitpick.style import Style +from nitpick.typedefs import JsonDict, PathOrStr, StrOrList, YieldFlake8Error LOGGER = logging.getLogger("{}.config".format(LOG_ROOT)) @@ -122,7 +122,7 @@ def merge_styles(self) -> YieldFlake8Error: style.find_initial_styles(configured_styles) self.style_dict = style.merge_toml_dict() - from flake8_nitpick.plugin import NitpickChecker + from nitpick.plugin import NitpickChecker minimum_version = search_dict(NITPICK_MINIMUM_VERSION_JMEX, self.style_dict, None) if minimum_version and version_to_tuple(NitpickChecker.version) < version_to_tuple(minimum_version): diff --git a/flake8_nitpick/constants.py b/nitpick/constants.py similarity index 89% rename from flake8_nitpick/constants.py rename to nitpick/constants.py index e3385fb5..47313000 100644 --- a/flake8_nitpick/constants.py +++ b/nitpick/constants.py @@ -2,15 +2,15 @@ """Constants.""" import jmespath -from flake8_nitpick import __version__ +from nitpick import __version__ -PROJECT_NAME = "flake8-nitpick" +PROJECT_NAME = "nitpick" ERROR_PREFIX = "NIP" LOG_ROOT = PROJECT_NAME.replace("-", ".") TOML_EXTENSION = ".toml" NITPICK_STYLE_TOML = "nitpick-style{}".format(TOML_EXTENSION) NITPICK_VERSION = "v{}".format(__version__) -DEFAULT_NITPICK_STYLE_URL = "https://raw.githubusercontent.com/andreoliwa/flake8-nitpick/{}/{}".format( +DEFAULT_NITPICK_STYLE_URL = "https://raw.githubusercontent.com/andreoliwa/nitpick/{}/{}".format( NITPICK_VERSION, NITPICK_STYLE_TOML ) MANAGE_PY = "manage.py" diff --git a/flake8_nitpick/files/__init__.py b/nitpick/files/__init__.py similarity index 72% rename from flake8_nitpick/files/__init__.py rename to nitpick/files/__init__.py index 93174d50..af8ac4df 100644 --- a/flake8_nitpick/files/__init__.py +++ b/nitpick/files/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- """Files that are checked by Nitpick.""" # TODO: load all modules under files/*, so get_subclasses() detects them. -import flake8_nitpick.files.pre_commit # noqa: F401 +import nitpick.files.pre_commit # noqa: F401 diff --git a/flake8_nitpick/files/base.py b/nitpick/files/base.py similarity index 92% rename from flake8_nitpick/files/base.py rename to nitpick/files/base.py index c5dbe310..37088883 100644 --- a/flake8_nitpick/files/base.py +++ b/nitpick/files/base.py @@ -3,9 +3,9 @@ import abc from pathlib import Path -from flake8_nitpick.generic import search_dict -from flake8_nitpick.mixin import NitpickMixin -from flake8_nitpick.typedefs import JsonDict, YieldFlake8Error +from nitpick.generic import search_dict +from nitpick.mixin import NitpickMixin +from nitpick.typedefs import JsonDict, YieldFlake8Error class BaseFile(NitpickMixin, metaclass=abc.ABCMeta): @@ -16,7 +16,7 @@ class BaseFile(NitpickMixin, metaclass=abc.ABCMeta): def __init__(self) -> None: """Init instance.""" - from flake8_nitpick.config import NitpickConfig + from nitpick.config import NitpickConfig self.config = NitpickConfig.get_singleton() self.error_prefix = "File {}".format(self.file_name) diff --git a/flake8_nitpick/files/pre_commit.py b/nitpick/files/pre_commit.py similarity index 97% rename from flake8_nitpick/files/pre_commit.py rename to nitpick/files/pre_commit.py index 9dee0df0..60f3cd94 100644 --- a/flake8_nitpick/files/pre_commit.py +++ b/nitpick/files/pre_commit.py @@ -5,9 +5,9 @@ import dictdiffer import yaml -from flake8_nitpick.files.base import BaseFile -from flake8_nitpick.generic import find_object_by_key -from flake8_nitpick.typedefs import YieldFlake8Error +from nitpick.files.base import BaseFile +from nitpick.generic import find_object_by_key +from nitpick.typedefs import YieldFlake8Error class PreCommitFile(BaseFile): diff --git a/flake8_nitpick/files/pyproject_toml.py b/nitpick/files/pyproject_toml.py similarity index 90% rename from flake8_nitpick/files/pyproject_toml.py rename to nitpick/files/pyproject_toml.py index f621761e..ceadfe01 100644 --- a/flake8_nitpick/files/pyproject_toml.py +++ b/nitpick/files/pyproject_toml.py @@ -2,9 +2,9 @@ """Checker for the `pyproject.toml `_ config file (`PEP 518 `_).""" import toml -from flake8_nitpick.files.base import BaseFile -from flake8_nitpick.generic import flatten, unflatten -from flake8_nitpick.typedefs import YieldFlake8Error +from nitpick.files.base import BaseFile +from nitpick.generic import flatten, unflatten +from nitpick.typedefs import YieldFlake8Error class PyProjectTomlFile(BaseFile): diff --git a/flake8_nitpick/files/setup_cfg.py b/nitpick/files/setup_cfg.py similarity index 97% rename from flake8_nitpick/files/setup_cfg.py rename to nitpick/files/setup_cfg.py index 8ab17ad4..dec5460e 100644 --- a/flake8_nitpick/files/setup_cfg.py +++ b/nitpick/files/setup_cfg.py @@ -7,8 +7,8 @@ import dictdiffer -from flake8_nitpick.files.base import BaseFile -from flake8_nitpick.typedefs import YieldFlake8Error +from nitpick.files.base import BaseFile +from nitpick.typedefs import YieldFlake8Error class SetupCfgFile(BaseFile): diff --git a/flake8_nitpick/generic.py b/nitpick/generic.py similarity index 98% rename from flake8_nitpick/generic.py rename to nitpick/generic.py index ab45497c..b7664d52 100644 --- a/flake8_nitpick/generic.py +++ b/nitpick/generic.py @@ -3,7 +3,7 @@ .. testsetup:: - from flake8_nitpick.generic import * + from nitpick.generic import * """ import collections from pathlib import Path @@ -12,7 +12,7 @@ import jmespath from jmespath.parser import ParsedResult -from flake8_nitpick.typedefs import PathOrStr +from nitpick.typedefs import PathOrStr def get_subclasses(cls): diff --git a/flake8_nitpick/mixin.py b/nitpick/mixin.py similarity index 78% rename from flake8_nitpick/mixin.py rename to nitpick/mixin.py index 222232f5..89864792 100644 --- a/flake8_nitpick/mixin.py +++ b/nitpick/mixin.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Mixin to raise flake8 errors.""" -from flake8_nitpick.constants import ERROR_PREFIX -from flake8_nitpick.typedefs import Flake8Error +from nitpick.constants import ERROR_PREFIX +from nitpick.typedefs import Flake8Error class NitpickMixin: @@ -14,7 +14,7 @@ def flake8_error(self, error_number: int, error_message: str) -> Flake8Error: """Return a flake8 error as a tuple.""" final_number = self.error_base_number + error_number - from flake8_nitpick.plugin import NitpickChecker + from nitpick.plugin import NitpickChecker return ( 1, diff --git a/flake8_nitpick/plugin.py b/nitpick/plugin.py similarity index 80% rename from flake8_nitpick/plugin.py rename to nitpick/plugin.py index 671a4d9f..ed6fdd14 100644 --- a/flake8_nitpick/plugin.py +++ b/nitpick/plugin.py @@ -6,13 +6,13 @@ import attr -from flake8_nitpick import __version__ -from flake8_nitpick.config import NitpickConfig -from flake8_nitpick.constants import LOG_ROOT, PROJECT_NAME, ROOT_PYTHON_FILES -from flake8_nitpick.files.base import BaseFile -from flake8_nitpick.generic import get_subclasses -from flake8_nitpick.mixin import NitpickMixin -from flake8_nitpick.typedefs import YieldFlake8Error +from nitpick import __version__ +from nitpick.config import NitpickConfig +from nitpick.constants import LOG_ROOT, PROJECT_NAME, ROOT_PYTHON_FILES +from nitpick.files.base import BaseFile +from nitpick.generic import get_subclasses +from nitpick.mixin import NitpickMixin +from nitpick.typedefs import YieldFlake8Error LOGGER = logging.getLogger("{}.plugin".format(LOG_ROOT)) @@ -53,9 +53,6 @@ def run(self) -> YieldFlake8Error: LOGGER.info("Ignoring file: %s", self.filename) return LOGGER.info("Nitpicking file: %s", self.filename) - yield self.flake8_error( - 4, "This project will be renamed to 'nitpick' on the next version. Please update pyproject.toml" - ) # FIXME: remove when project is renamed yield from itertools.chain(self.config.merge_styles(), self.check_absent_files()) diff --git a/flake8_nitpick/style.py b/nitpick/style.py similarity index 95% rename from flake8_nitpick/style.py rename to nitpick/style.py index c69eead5..3c743689 100644 --- a/flake8_nitpick/style.py +++ b/nitpick/style.py @@ -10,7 +10,7 @@ import toml from slugify import slugify -from flake8_nitpick.constants import ( +from nitpick.constants import ( DEFAULT_NITPICK_STYLE_URL, LOG_ROOT, NITPICK_STYLE_TOML, @@ -18,12 +18,12 @@ TOML_EXTENSION, UNIQUE_SEPARATOR, ) -from flake8_nitpick.files.pyproject_toml import PyProjectTomlFile -from flake8_nitpick.generic import climb_directory_tree, flatten, is_url, search_dict, unflatten -from flake8_nitpick.typedefs import JsonDict, StrOrList +from nitpick.files.pyproject_toml import PyProjectTomlFile +from nitpick.generic import climb_directory_tree, flatten, is_url, search_dict, unflatten +from nitpick.typedefs import JsonDict, StrOrList if TYPE_CHECKING: - from flake8_nitpick.config import NitpickConfig + from nitpick.config import NitpickConfig LOGGER = logging.getLogger("{}.style".format(LOG_ROOT)) diff --git a/flake8_nitpick/typedefs.py b/nitpick/typedefs.py similarity index 100% rename from flake8_nitpick/typedefs.py rename to nitpick/typedefs.py diff --git a/package.json b/package.json index 4b48f845..89a98d36 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "flake8-nitpick", + "name": "nitpick", "version": "0.13.1", "repository": { "type": "git", - "url": "https://github.com/andreoliwa/flake8-nitpick.git" + "url": "https://github.com/andreoliwa/nitpick.git" }, "release": { "plugins": [ @@ -28,7 +28,7 @@ { "assets": [ "setup.cfg", - "flake8_nitpick/__init__.py", + "nitpick/__init__.py", "pyproject.toml", "package.json", "docs/conf.py", diff --git a/poetry.lock b/poetry.lock index f6f953cc..721df744 100644 --- a/poetry.lock +++ b/poetry.lock @@ -493,7 +493,7 @@ description = "YAML parser and emitter for Python" name = "pyyaml" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "5.1" +version = "5.1.1" [[package]] category = "main" @@ -680,7 +680,7 @@ version = "0.1.7" [[package]] category = "dev" description = "Enable Unicode input and display when running Python from Windows console." -marker = "sys_platform == \"win32\" and python_version < \"3.6\" or sys_platform == \"win32\" and python_version < \"3.6\" and python_version >= \"3.4\"" +marker = "sys_platform == \"win32\" and python_version < \"3.6\" and python_version >= \"3.4\" or sys_platform == \"win32\" and python_version < \"3.6\"" name = "win-unicode-console" optional = false python-versions = "*" @@ -755,7 +755,7 @@ pytest-repeat = ["52bc413ab1a772e72c953a5592196ddd266fd2e76280eaac0c2a8378e9ac6d pytest-runfailed = ["82ab0740355ecde835d9754bcc510d6993e0b89d71d109894d1d6fbfeb9c222a"] python-slugify = ["57163ffb345c7e26063435a27add1feae67fa821f1ef4b2f292c25847575d758"] pytz = ["303879e36b721603cc54604edcac9d20401bdbe31e1e4fdee5b9f98d5d31dfda", "d747dd3d23d77ef44c6a3526e274af6efeb0a6f1afd5a69ba4d5be4098c8e141"] -pyyaml = ["1adecc22f88d38052fb787d959f003811ca858b799590a5eaa70e63dca50308c", "436bc774ecf7c103814098159fbb84c2715d25980175292c648f2da143909f95", "460a5a4248763f6f37ea225d19d5c205677d8d525f6a83357ca622ed541830c2", "5a22a9c84653debfbf198d02fe592c176ea548cccce47553f35f466e15cf2fd4", "7a5d3f26b89d688db27822343dfa25c599627bc92093e788956372285c6298ad", "9372b04a02080752d9e6f990179a4ab840227c6e2ce15b95e1278456664cf2ba", "a5dcbebee834eaddf3fa7366316b880ff4062e4bcc9787b78c7fbb4a26ff2dd1", "aee5bab92a176e7cd034e57f46e9df9a9862a71f8f37cad167c6fc74c65f5b4e", "c51f642898c0bacd335fc119da60baae0824f2cde95b0330b56c0553439f0673", "c68ea4d3ba1705da1e0d85da6684ac657912679a649e8868bd850d2c299cce13", "e23d0cc5299223dcc37885dae624f382297717e459ea24053709675a976a3e19"] +pyyaml = ["57acc1d8533cbe51f6662a55434f0dbecfa2b9eaf115bede8f6fd00115a0c0d3", "588c94b3d16b76cfed8e0be54932e5729cc185caffaa5a451e7ad2f7ed8b4043", "68c8dd247f29f9a0d09375c9c6b8fdc64b60810ebf07ba4cdd64ceee3a58c7b7", "70d9818f1c9cd5c48bb87804f2efc8692f1023dac7f1a1a5c61d454043c1d265", "86a93cccd50f8c125286e637328ff4eef108400dd7089b46a7be3445eecfa391", "a0f329125a926876f647c9fa0ef32801587a12328b4a3c741270464e3e4fa778", "a3c252ab0fa1bb0d5a3f6449a4826732f3eb6c0270925548cac342bc9b22c225", "b4bb4d3f5e232425e25dda21c070ce05168a786ac9eda43768ab7f3ac2770955", "cd0618c5ba5bda5f4039b9398bb7fb6a317bb8298218c3de25c47c4740e4b95e", "ceacb9e5f8474dcf45b940578591c7f3d960e82f926c707788a570b51ba59190", "fe6a88094b64132c4bb3b631412e90032e8cfe9745a58370462240b8cb7553cd"] requests = ["11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", "9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31"] responses = ["502d9c0c8008439cfcdef7e251f507fcfdd503b56e8c0c87c3c3e3393953f790", "97193c0183d63fba8cd3a041c75464e4b09ea0aff6328800d1546598567dde0b"] six = ["3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"] diff --git a/pyproject.toml b/pyproject.toml index c66c7db1..309c9b51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,13 +6,13 @@ style = ["nitpick-style", "styles/python35-36-37"] line-length = 120 [tool.poetry] -name = "flake8-nitpick" +name = "nitpick" version = "0.13.1" description = "Flake8 plugin to enforce the same lint configuration (flake8, isort, mypy, pylint) across multiple Python projects" authors = ["W. Augusto Andreoli "] license = "MIT" readme = "README.md" -repository = "https://github.com/andreoliwa/flake8-nitpick" +repository = "https://github.com/andreoliwa/nitpick" keywords = ["python3", "flake8", "linter", "styleguide"] classifiers = [ "Development Status :: 3 - Alpha", @@ -25,7 +25,7 @@ classifiers = [ ] [tool.poetry.plugins."flake8.extension"] -NIP = "flake8_nitpick.plugin:NitpickChecker" +NIP = "nitpick.plugin:NitpickChecker" [tool.poetry.dependencies] python = "^3.5 || ^3.6 || ^3.7" diff --git a/setup.cfg b/setup.cfg index d0b8df84..6b743289 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ current_version = 0.13.1 commit = False tag = False -[bumpversion:file:flake8_nitpick/__init__.py] +[bumpversion:file:nitpick/__init__.py] search = __version__ = "{current_version}" replace = __version__ = "{new_version}" @@ -54,4 +54,3 @@ warn_unused_ignores = True [tool:pytest] addopts = -v --doctest-modules - diff --git a/tests/conftest.py b/tests/conftest.py index c39fb662..ba76224b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,7 +7,7 @@ import pytest -from flake8_nitpick.config import NitpickConfig +from nitpick.config import NitpickConfig # Fixed temporary dir to help debugging, or a temporary dir ENV_TEST_DIR = os.environ.get("NITPICK_TEST_DIR") diff --git a/tests/helpers.py b/tests/helpers.py index 7b916730..462cdd3b 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -8,12 +8,12 @@ from _pytest.fixtures import FixtureRequest -from flake8_nitpick.constants import ERROR_PREFIX, NITPICK_STYLE_TOML -from flake8_nitpick.files.pre_commit import PreCommitFile -from flake8_nitpick.files.pyproject_toml import PyProjectTomlFile -from flake8_nitpick.files.setup_cfg import SetupCfgFile -from flake8_nitpick.plugin import NitpickChecker -from flake8_nitpick.typedefs import Flake8Error, PathOrStr +from nitpick.constants import ERROR_PREFIX, NITPICK_STYLE_TOML +from nitpick.files.pre_commit import PreCommitFile +from nitpick.files.pyproject_toml import PyProjectTomlFile +from nitpick.files.setup_cfg import SetupCfgFile +from nitpick.plugin import NitpickChecker +from nitpick.typedefs import Flake8Error, PathOrStr from tests.conftest import TEMP_ROOT_PATH @@ -57,15 +57,6 @@ def lint(self, file_index: int = 0) -> "ProjectMock": npc = NitpickChecker(filename=str(self.files_to_lint[file_index])) self._original_errors = list(npc.run()) - # FIXME: remove when project is renamed - clean_errors = [] - for flake8_error in self._original_errors: - line, col, message, class_ = flake8_error - if message.startswith("NIP104"): - continue - clean_errors.append(flake8_error) - self._original_errors = clean_errors - self._errors = set() for flake8_error in self._original_errors: line, col, message, class_ = flake8_error diff --git a/tests/test_config.py b/tests/test_config.py index 506b266a..75fd03e3 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """Config tests.""" -from flake8_nitpick.constants import ROOT_PYTHON_FILES +from nitpick.constants import ROOT_PYTHON_FILES from tests.helpers import ProjectMock diff --git a/tests/test_generic.py b/tests/test_generic.py index ae7fcc3a..eb1bb5c0 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """Generic functions tests.""" -from flake8_nitpick.generic import get_subclasses +from nitpick.generic import get_subclasses def test_get_subclasses(): diff --git a/tests/test_pyproject_toml.py b/tests/test_pyproject_toml.py index 9b45519a..1c3cdd80 100644 --- a/tests/test_pyproject_toml.py +++ b/tests/test_pyproject_toml.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """pyproject.toml tests.""" -from flake8_nitpick.files.pyproject_toml import PyProjectTomlFile +from nitpick.files.pyproject_toml import PyProjectTomlFile from tests.helpers import ProjectMock diff --git a/tests/test_style.py b/tests/test_style.py index c2ebbda3..3b049e94 100644 --- a/tests/test_style.py +++ b/tests/test_style.py @@ -7,7 +7,7 @@ import responses -from flake8_nitpick.constants import TOML_EXTENSION +from nitpick.constants import TOML_EXTENSION from tests.conftest import TEMP_ROOT_PATH from tests.helpers import ProjectMock @@ -141,7 +141,7 @@ def test_include_styles_overriding_values(request): ) -@mock.patch("flake8_nitpick.plugin.NitpickChecker.version", new_callable=PropertyMock(return_value="0.5.3")) +@mock.patch("nitpick.plugin.NitpickChecker.version", new_callable=PropertyMock(return_value="0.5.3")) def test_minimum_version(mocked_version, request): """Stamp a style file with a minimum required version, to indicate new features or breaking changes.""" assert mocked_version == "0.5.3" @@ -173,7 +173,7 @@ def test_minimum_version(mocked_version, request): ) .lint() .assert_single_error( - "NIP203 The style file you're using requires flake8-nitpick>=1.0 (you have 0.5.3). Please upgrade" + "NIP203 The style file you're using requires nitpick>=1.0 (you have 0.5.3). Please upgrade" ) )