From 38184cdded6bd5982d11a38cd4a570847328f76f Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 14 Jan 2019 21:55:47 +0000 Subject: [PATCH] Migrate linting to pre-commit --- .idea/.name | 1 - .idea/ant.xml | 7 - .idea/atlassian-ide-plugin.xml | 5 - .idea/codeStyleSettings.xml | 18 - .idea/compiler.xml | 25 - .idea/copyright/profiles_settings.xml | 5 - .idea/cssxfire.xml | 9 - .idea/encodings.xml | 6 - .idea/inspectionProfiles/Project_Default.xml | 11 - .../inspectionProfiles/profiles_settings.xml | 7 - .idea/other.xml | 7 - .idea/projectCodeStyle.xml | 80 --- .idea/scopes/scope_settings.xml | 5 - .idea/testrunner.xml | 8 - .idea/uiDesigner.xml | 125 ---- .idea/vcs.xml | 10 - .pre-commit-config.yaml | 27 + .travis.yml | 140 ++--- .yamllint | 10 + CHANGES.txt | 1 - LICENSE | 2 +- docs/index.rst | 3 +- projectFilesBackup/.idea/workspace.xml | 562 ------------------ requirements-dev.txt | 15 +- requirements.txt | 2 +- tox.ini | 4 +- 26 files changed, 121 insertions(+), 974 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/ant.xml delete mode 100644 .idea/atlassian-ide-plugin.xml delete mode 100644 .idea/codeStyleSettings.xml delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/cssxfire.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/other.xml delete mode 100644 .idea/projectCodeStyle.xml delete mode 100644 .idea/scopes/scope_settings.xml delete mode 100644 .idea/testrunner.xml delete mode 100644 .idea/uiDesigner.xml delete mode 100644 .idea/vcs.xml create mode 100644 .pre-commit-config.yaml create mode 100644 .yamllint delete mode 100644 projectFilesBackup/.idea/workspace.xml diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 9d89b77..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -tendo \ No newline at end of file diff --git a/.idea/ant.xml b/.idea/ant.xml deleted file mode 100644 index 2581ca3..0000000 --- a/.idea/ant.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/.idea/atlassian-ide-plugin.xml b/.idea/atlassian-ide-plugin.xml deleted file mode 100644 index 858eed5..0000000 --- a/.idea/atlassian-ide-plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml deleted file mode 100644 index 3a9ee58..0000000 --- a/.idea/codeStyleSettings.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index b22c943..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index 3572571..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/cssxfire.xml b/.idea/cssxfire.xml deleted file mode 100644 index f0550da..0000000 --- a/.idea/cssxfire.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index f758959..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index aa54d65..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b31283..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/other.xml b/.idea/other.xml deleted file mode 100644 index a7f0eb1..0000000 --- a/.idea/other.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/.idea/projectCodeStyle.xml b/.idea/projectCodeStyle.xml deleted file mode 100644 index 4fbb582..0000000 --- a/.idea/projectCodeStyle.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/testrunner.xml b/.idea/testrunner.xml deleted file mode 100644 index 0d97b74..0000000 --- a/.idea/testrunner.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index 3b00020..0000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 55cd839..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1c23ac8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,27 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.1.0 + hooks: + - id: trailing-whitespace + exclude: ^tendo/tests/.*\.txt$ + - id: end-of-file-fixer + exclude: ^tendo/tests/.*\.txt$ + - id: mixed-line-ending + exclude: ^tendo/tests/.*\.txt$ + - id: check-byte-order-marker + exclude: ^tendo/tests/.*\.txt$ + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-symlinks + - id: check-vcs-permalinks + - id: flake8 + - id: debug-statements + - id: requirements-txt-fixer + - id: check-yaml + files: .*\.(yaml|yml)$ + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.14.0 + hooks: + - id: yamllint + files: \.(yaml|yml)$ diff --git a/.travis.yml b/.travis.yml index 63730bf..b564c2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,80 +1,84 @@ --- language: python cache: -- pip + - pip os: -- linux + - linux stages: -- phase1 -- phase2 -- deploy + - phase1 + - phase2 + - deploy before_install: - - which tox >/dev/null || if [ -z ${VIRTUAL_ENV+x} ]; then python -m pip install --user tox tox-pyenv wheel ; else python -m pip install tox tox-pyenv wheel twine; fi + - | + which tox >/dev/null || if [ -z ${VIRTUAL_ENV+x} ]; + then python -m pip install --user tox tox-pyenv wheel ; + else python -m pip install tox tox-pyenv wheel twine; + fi notifications: email: - - pycontribs@googlegroups.com + - pycontribs@googlegroups.com jobs: include: - - stage: phase1 - script: - - python setup.py sdist bdist_wheel - - python -m tox - env: TOXENV=lint - python: '2.7' - - stage: phase1 - script: python -m tox - python: '2.7' - env: TOXENV=docs - - stage: phase1 - script: python -m tox - python: '2.7' - env: TOXENV=py27 - after_success: - - bash <(curl -s https://codecov.io/bash) -e TOX_ENV - - stage: phase2 - script: python -m tox - python: '3.4' - env: TOXENV=py34 - after_success: - - bash <(curl -s https://codecov.io/bash) -e TOX_ENV - - stage: phase2 - script: python -m tox - python: '3.5' - env: TOXENV=py35 - after_success: - - bash <(curl -s https://codecov.io/bash) -e TOX_ENV - - stage: phase2 - script: python -m tox - python: '3.6' - env: TOXENV=py36 PYTHON='3.6' PYENV_VERSION='system' - after_success: - - bash <(curl -s https://codecov.io/bash) -e TOX_ENV - - stage: phase2 - script: python -m pip install -q tox-travis && python -m tox - python: '3.7' - env: TOXENV=py37 PYTHON='3.7' - after_success: - - bash <(curl -s https://codecov.io/bash) -e TOX_ENV - dist: xenial - sudo: required - - stage: deploy - script: - - python setup.py sdist bdist_wheel - - python -m twine upload dist/* - if: tag IS present - deploy: - - provider: releases - api_key: - secure: 0Id8K7AgZ4KtOsa1N8Z0B7qCz9H/hP8xr475u+Q7aapguCGMf3K4KEJZ/yKFNxgPMM2Rl3n2jFsO3+0AfSV+no7ISP9v592FY/0vIGkrZ/aqxvcnUFpwsrXvS5bNfWEfTqFFddwG6u3vMFHyg0vCbUGOXl35EGH+xlnIhYPU30XFxAWwBQPOrQW1qmkkA3VMxtOMgYFzCd42P+7qo+Wt2Wcg7BFNpMVxMPEDUd1Ooi1zOOLJTl8FWo1s5ayksG5RxnYNqGTK+7FEfB/1FNa5SGOrtFXedWcH2qjMe3VUVaEHowNvOC+48DVjmlevpLBsarHRCvFES36MuJfvi3uaVPZDgkXiUV/uY0OhJDMclfG/tI7etefObLLft2RKusl06CNavDJN9RmKrjtvzOSo1sfjtdFu/2er80lrE8ph8olymXZHeF7EbDn+51vALBuICL8M7yaoO6v3rCg+QkKSJB+9/75nDl4rWusqdxGdt/9cG6et3l+yBiinrFZ6BHMk8UH7ItD17TQU6tiQDi7Fj1vEW3P++qLnQUkcdnCf0ASJBJCL1X1Pa9ddgtxf+4XuQqNlXvpyGhbTrDAdZtGjk2As0eL4Uq3xqiVGWEdj2veTGS4oct8dwmpuRRmUsUGhPX/LyYpiUpCkEZl71lZwK+ESeBL+zWkQuuJLMdT0/KQ= - file_glob: true - file: - - dist/* - - ChangeLog - skip_cleanup: true - on: - tags: true - repo: pycontribs/jira - branch: master + - stage: phase1 + script: + - python setup.py sdist bdist_wheel + - python -m tox + env: TOXENV=lint + python: '2.7' + - stage: phase1 + script: python -m tox + python: '2.7' + env: TOXENV=docs + - stage: phase1 + script: python -m tox + python: '2.7' + env: TOXENV=py27 + after_success: + - bash <(curl -s https://codecov.io/bash) -e TOX_ENV + - stage: phase2 + script: python -m tox + python: '3.4' + env: TOXENV=py34 + after_success: + - bash <(curl -s https://codecov.io/bash) -e TOX_ENV + - stage: phase2 + script: python -m tox + python: '3.5' + env: TOXENV=py35 + after_success: + - bash <(curl -s https://codecov.io/bash) -e TOX_ENV + - stage: phase2 + script: python -m tox + python: '3.6' + env: TOXENV=py36 PYTHON='3.6' PYENV_VERSION='system' + after_success: + - bash <(curl -s https://codecov.io/bash) -e TOX_ENV + - stage: phase2 + script: python -m pip install -q tox-travis && python -m tox + python: '3.7' + env: TOXENV=py37 PYTHON='3.7' + after_success: + - bash <(curl -s https://codecov.io/bash) -e TOX_ENV + dist: xenial + sudo: required + - stage: deploy + script: + - python setup.py sdist bdist_wheel + - python -m twine upload dist/* + if: tag IS present + deploy: + - provider: releases + api_key: + secure: 0Id8K7AgZ4KtOsa1N8Z0B7qCz9H/hP8xr475u+Q7aapguCGMf3K4KEJZ/yKFNxgPMM2Rl3n2jFsO3+0AfSV+no7ISP9v592FY/0vIGkrZ/aqxvcnUFpwsrXvS5bNfWEfTqFFddwG6u3vMFHyg0vCbUGOXl35EGH+xlnIhYPU30XFxAWwBQPOrQW1qmkkA3VMxtOMgYFzCd42P+7qo+Wt2Wcg7BFNpMVxMPEDUd1Ooi1zOOLJTl8FWo1s5ayksG5RxnYNqGTK+7FEfB/1FNa5SGOrtFXedWcH2qjMe3VUVaEHowNvOC+48DVjmlevpLBsarHRCvFES36MuJfvi3uaVPZDgkXiUV/uY0OhJDMclfG/tI7etefObLLft2RKusl06CNavDJN9RmKrjtvzOSo1sfjtdFu/2er80lrE8ph8olymXZHeF7EbDn+51vALBuICL8M7yaoO6v3rCg+QkKSJB+9/75nDl4rWusqdxGdt/9cG6et3l+yBiinrFZ6BHMk8UH7ItD17TQU6tiQDi7Fj1vEW3P++qLnQUkcdnCf0ASJBJCL1X1Pa9ddgtxf+4XuQqNlXvpyGhbTrDAdZtGjk2As0eL4Uq3xqiVGWEdj2veTGS4oct8dwmpuRRmUsUGhPX/LyYpiUpCkEZl71lZwK+ESeBL+zWkQuuJLMdT0/KQ= + file_glob: true + file: + - dist/* + - ChangeLog + skip_cleanup: true + on: + tags: true + repo: pycontribs/jira + branch: master env: global: - - PIP_DISABLE_PIP_VERSION_CHECK=1 + - PIP_DISABLE_PIP_VERSION_CHECK=1 diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..35acc5c --- /dev/null +++ b/.yamllint @@ -0,0 +1,10 @@ +--- + +rules: + line-length: + max: 999 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + key-duplicates: enable +ignore: | + .tox diff --git a/CHANGES.txt b/CHANGES.txt index 5c7ef7e..b3b4e8b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,4 +8,3 @@ 2010-07-29 version 0.0.1 * initial release, created the package - diff --git a/LICENSE b/LICENSE index 11a24e3..e788899 100644 --- a/LICENSE +++ b/LICENSE @@ -191,4 +191,4 @@ FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/docs/index.rst b/docs/index.rst index aa7108c..482016c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,7 +17,7 @@ singleton .. automodule:: tendo.singleton .. autoclass:: SingleInstance - :members: + :members: ======= colorer @@ -52,4 +52,3 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` * :ref:`search` - diff --git a/projectFilesBackup/.idea/workspace.xml b/projectFilesBackup/.idea/workspace.xml deleted file mode 100644 index 13b68f7..0000000 --- a/projectFilesBackup/.idea/workspace.xml +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1308642690513 - 1308642690513 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/requirements-dev.txt b/requirements-dev.txt index 48ae1f2..f146347 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,12 +1,11 @@ -hacking>=1.1.0 - -Sphinx -autopep8 coveralls -pytest>=2.6.0 +docutils +MarkupSafe +pre-commit pytest-cov -pytest-xdist pytest-instafail +pytest-xdist +pytest>=2.6.0 + +Sphinx wheel -docutils -MarkupSafe diff --git a/requirements.txt b/requirements.txt index 8cb5de9..c0c94c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ pbr pip +setuptools six>=1.7.2 -setuptools \ No newline at end of file diff --git a/tox.ini b/tox.ini index 33d51ba..3008f9f 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,6 @@ commands= sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html [testenv:lint] +deps = -rrequirements-dev.txt commands= - python -m pip -q install -rrequirements-dev.txt -rrequirements.txt - flake8 + python -m pre_commit run --all