From 0129ecd6b41f71e5be1d3fa8d6a69538bb0faf50 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 5 Oct 2023 07:34:53 -0700 Subject: [PATCH 01/40] Convert to pyproject.toml configuration. --- .github/workflows/tests.yaml | 11 ++----- pyproject.toml | 58 ++++++++++++++++++++++++++++++++++++ requirements.txt | 5 ---- setup.py | 58 ------------------------------------ 4 files changed, 61 insertions(+), 71 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ae4adcd..0dd9bb9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -56,14 +56,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install --upgrade wheel - python -m pip install --upgrade coverage - python -m pip install --upgrade mypy - python -m pip install --upgrade types-docutils - python -m pip install --upgrade tox - python -m pip install --upgrade tox-gh-actions - python -m pip install --upgrade virtualenv + python -m pip install . + python -m pip install .[testing] + python -m pip install .[docs] # Have to install newer version from non-apt source due to SSL library compatibility issues. - name: Install Node and node-based tools (Linux) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..20262fb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "statick-md" +authors = [{name = "NIWC Pacific"}] +description="Statick analysis plugins for Markdown files." +version = "0.1.3" +readme = "README.md" +requires-python = ">=3.8" +license = {text = "CC0-1.0"} +classifiers = [ + "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Software Development :: Testing", +] +dependencies = [ + "mypy", + "proselint", + "restructuredtext-lint", + "rstcheck", + "sphinx", + "statick", + "types-docutils", +] + +[tool.setuptools.package-data] +statick_tool = [ + "plugins/*.py", + "plugins/discovery/*", + "plugins/tool/*", + "rsc/*", + "rsc/.*", +] + +[project.urls] +"Homepage" = "https://github.com/sscpac/statick-md" +"Bug Tracker" = "https://github.com/sscpac/statick-md/issues" +[project.optional-dependencies] +testing = [ + "backports.tempfile", + "coverage", + "mock", + "pytest", + "tox", + "tox-gh-actions", +] +docs = [ + "sphinx==1.7.9", + "travis-sphinx==2.2.1", + "yaml-1.3", + "yapsy", +] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 173cd39..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -statick -proselint -restructuredtext-lint -rstcheck -sphinx diff --git a/setup.py b/setup.py deleted file mode 100644 index 8dd99c4..0000000 --- a/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Setup.""" - - -from setuptools import setup - -with open("README.md", encoding="utf8") as fid: - long_description = fid.read() # pylint: disable=invalid-name - -TEST_DEPS = [ - "mock", - "pytest", -] - -EXTRAS = { - "test": TEST_DEPS, -} - -setup( - author="NIWC Pacific", - name="statick-md", - description="Statick analysis plugins for Markdown files.", - version="0.1.3", - packages=[ - "statick_tool", - "statick_tool.plugins.discovery", - "statick_tool.plugins.tool", - ], - package_dir={ - "statick_tool": ".", - "statick_tool.plugins.discovery": "src/statick_md/plugins/discovery", - "statick_tool.plugins.tool": "src/statick_md/plugins/tool", - }, - package_data={ - "statick_tool": ["rsc/.*", "rsc/*"], - "statick_tool.plugins.discovery": ["*.yapsy-plugin"], - "statick_tool.plugins.tool": ["*.yapsy-plugin"], - }, - long_description=long_description, - long_description_content_type="text/markdown", - install_requires=[ - "proselint", - "restructuredtext-lint", - "rstcheck", - "sphinx", - "statick", - ], - tests_require=TEST_DEPS, - extras_require=EXTRAS, - url="https://github.com/sscpac/statick-md", - classifiers=[ - "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Software Development :: Testing", - ], -) From d175fef02864bb763c1375c5cf670ab8305465f9 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 5 Oct 2023 08:40:32 -0700 Subject: [PATCH 02/40] Slim down package data, install mock for tox. --- pyproject.toml | 5 ++--- tox.ini | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 20262fb..cefd3a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,9 +31,8 @@ dependencies = [ [tool.setuptools.package-data] statick_tool = [ - "plugins/*.py", - "plugins/discovery/*", - "plugins/tool/*", + "plugins/discovery/*.yapsy-plugin", + "plugins/tool/*.yapsy-plugin", "rsc/*", "rsc/.*", ] diff --git a/tox.ini b/tox.ini index 9b32edc..c7443b4 100644 --- a/tox.ini +++ b/tox.ini @@ -36,6 +36,7 @@ setenv = PY_IGNORE_IMPORTMISMATCH = 1 deps = flake8<5 # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. flake8-pep3101 + mock pycodestyle<2.9.0 # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. pydocstyle pytest From e14422ebb5c97ae5374dba231dd4c1bfc341adf3 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 5 Oct 2023 09:13:57 -0700 Subject: [PATCH 03/40] Move tox dependencies to pyproject.toml. --- pyproject.toml | 10 +++++++++- tox.ini | 9 --------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cefd3a4..05d2449 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,12 +40,20 @@ statick_tool = [ [project.urls] "Homepage" = "https://github.com/sscpac/statick-md" "Bug Tracker" = "https://github.com/sscpac/statick-md/issues" + [project.optional-dependencies] -testing = [ +test = [ "backports.tempfile", "coverage", + "flake8-pep3101", + "flake8<5", # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. "mock", + "pycodestyle<2.9.0", # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. + "pydocstyle", "pytest", + "pytest-cov", + "pytest-flake8", + "pytest-isort", "tox", "tox-gh-actions", ] diff --git a/tox.ini b/tox.ini index c7443b4..8c6fcbe 100644 --- a/tox.ini +++ b/tox.ini @@ -34,15 +34,6 @@ changedir = {toxinidir}/output-{envname} passenv = CI setenv = PY_IGNORE_IMPORTMISMATCH = 1 deps = - flake8<5 # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. - flake8-pep3101 - mock - pycodestyle<2.9.0 # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. - pydocstyle - pytest - pytest-cov - pytest-flake8 - pytest-isort .[test] commands = pydocstyle ../src/ From 77e1c5ccbd987cded23418d5295aee82269a17d2 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 5 Oct 2023 09:29:43 -0700 Subject: [PATCH 04/40] Fix install command. --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0dd9bb9..d09e332 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -57,7 +57,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install . - python -m pip install .[testing] + python -m pip install .[test] python -m pip install .[docs] # Have to install newer version from non-apt source due to SSL library compatibility issues. From 8e0752b49db10eb8bcf6f28996108cbc00e1b3e2 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 5 Oct 2023 09:34:14 -0700 Subject: [PATCH 05/40] Move mypy dependency to optional test section. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 05d2449..7277994 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,6 @@ classifiers = [ "Topic :: Software Development :: Testing", ] dependencies = [ - "mypy", "proselint", "restructuredtext-lint", "rstcheck", @@ -48,6 +47,7 @@ test = [ "flake8-pep3101", "flake8<5", # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. "mock", + "mypy", "pycodestyle<2.9.0", # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. "pydocstyle", "pytest", From 89f99d53b746916665234c668d465c5cc165a3f8 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 5 Oct 2023 09:38:11 -0700 Subject: [PATCH 06/40] Move flake8 max line length to correct spot. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8c6fcbe..628d18f 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,6 @@ envlist = py38, py39, py310, py311 skip_missing_interpreters = true [pytest] -flake8-max-line-length = 9000 norecursedirs = .tox # To work with black some items must be ignored. @@ -11,6 +10,7 @@ norecursedirs = .tox [flake8] exclude = .tox ignore = E203, E231, W503 +max-line-length = 9000 # To work with black a specific configuration is required. # https://github.com/psf/black#how-black-wraps-lines From 5f53668980e563ccfde2bf5f0eb07807e60c1f82 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Tue, 10 Oct 2023 10:04:59 -0700 Subject: [PATCH 07/40] Rename src directory. Move resource files into package. --- src/{statick_md => statick_tool}/__init__.py | 0 src/{statick_md => statick_tool}/plugins/__init__.py | 0 src/{statick_md => statick_tool}/plugins/discovery/__init__.py | 0 .../plugins/discovery/markdown_discovery_plugin.py | 0 .../plugins/discovery/markdown_discovery_plugin.yapsy-plugin | 0 .../plugins/discovery/rst_discovery_plugin.py | 0 .../plugins/discovery/rst_discovery_plugin.yapsy-plugin | 0 src/{statick_md => statick_tool}/plugins/tool/__init__.py | 0 .../plugins/tool/markdownlint_tool_plugin.py | 0 .../plugins/tool/markdownlint_tool_plugin.yapsy-plugin | 0 .../plugins/tool/proselint_tool_plugin.py | 0 .../plugins/tool/proselint_tool_plugin.yapsy-plugin | 0 .../plugins/tool/rstcheck_tool_plugin.py | 0 .../plugins/tool/rstcheck_tool_plugin.yapsy-plugin | 0 .../plugins/tool/rstlint_tool_plugin.py | 0 .../plugins/tool/rstlint_tool_plugin.yapsy-plugin | 0 .../plugins/tool/writegood_tool_plugin.py | 0 .../plugins/tool/writegood_tool_plugin.yapsy-plugin | 0 {rsc => src/statick_tool/rsc}/.markdownlintrc | 0 {rsc => src/statick_tool/rsc}/markdownlint-profile.yaml | 0 {rsc => src/statick_tool/rsc}/md-config.yaml | 0 {rsc => src/statick_tool/rsc}/md-profile.yaml | 0 {rsc => src/statick_tool/rsc}/rst-profile.yaml | 0 {rsc => src/statick_tool/rsc}/rstcheck-profile.yaml | 0 {rsc => src/statick_tool/rsc}/rstlint-profile.yaml | 0 {rsc => src/statick_tool/rsc}/writegood-profile.yaml | 0 26 files changed, 0 insertions(+), 0 deletions(-) rename src/{statick_md => statick_tool}/__init__.py (100%) rename src/{statick_md => statick_tool}/plugins/__init__.py (100%) rename src/{statick_md => statick_tool}/plugins/discovery/__init__.py (100%) rename src/{statick_md => statick_tool}/plugins/discovery/markdown_discovery_plugin.py (100%) rename src/{statick_md => statick_tool}/plugins/discovery/markdown_discovery_plugin.yapsy-plugin (100%) rename src/{statick_md => statick_tool}/plugins/discovery/rst_discovery_plugin.py (100%) rename src/{statick_md => statick_tool}/plugins/discovery/rst_discovery_plugin.yapsy-plugin (100%) rename src/{statick_md => statick_tool}/plugins/tool/__init__.py (100%) rename src/{statick_md => statick_tool}/plugins/tool/markdownlint_tool_plugin.py (100%) rename src/{statick_md => statick_tool}/plugins/tool/markdownlint_tool_plugin.yapsy-plugin (100%) rename src/{statick_md => statick_tool}/plugins/tool/proselint_tool_plugin.py (100%) rename src/{statick_md => statick_tool}/plugins/tool/proselint_tool_plugin.yapsy-plugin (100%) rename src/{statick_md => statick_tool}/plugins/tool/rstcheck_tool_plugin.py (100%) rename src/{statick_md => statick_tool}/plugins/tool/rstcheck_tool_plugin.yapsy-plugin (100%) rename src/{statick_md => statick_tool}/plugins/tool/rstlint_tool_plugin.py (100%) rename src/{statick_md => statick_tool}/plugins/tool/rstlint_tool_plugin.yapsy-plugin (100%) rename src/{statick_md => statick_tool}/plugins/tool/writegood_tool_plugin.py (100%) rename src/{statick_md => statick_tool}/plugins/tool/writegood_tool_plugin.yapsy-plugin (100%) rename {rsc => src/statick_tool/rsc}/.markdownlintrc (100%) rename {rsc => src/statick_tool/rsc}/markdownlint-profile.yaml (100%) rename {rsc => src/statick_tool/rsc}/md-config.yaml (100%) rename {rsc => src/statick_tool/rsc}/md-profile.yaml (100%) rename {rsc => src/statick_tool/rsc}/rst-profile.yaml (100%) rename {rsc => src/statick_tool/rsc}/rstcheck-profile.yaml (100%) rename {rsc => src/statick_tool/rsc}/rstlint-profile.yaml (100%) rename {rsc => src/statick_tool/rsc}/writegood-profile.yaml (100%) diff --git a/src/statick_md/__init__.py b/src/statick_tool/__init__.py similarity index 100% rename from src/statick_md/__init__.py rename to src/statick_tool/__init__.py diff --git a/src/statick_md/plugins/__init__.py b/src/statick_tool/plugins/__init__.py similarity index 100% rename from src/statick_md/plugins/__init__.py rename to src/statick_tool/plugins/__init__.py diff --git a/src/statick_md/plugins/discovery/__init__.py b/src/statick_tool/plugins/discovery/__init__.py similarity index 100% rename from src/statick_md/plugins/discovery/__init__.py rename to src/statick_tool/plugins/discovery/__init__.py diff --git a/src/statick_md/plugins/discovery/markdown_discovery_plugin.py b/src/statick_tool/plugins/discovery/markdown_discovery_plugin.py similarity index 100% rename from src/statick_md/plugins/discovery/markdown_discovery_plugin.py rename to src/statick_tool/plugins/discovery/markdown_discovery_plugin.py diff --git a/src/statick_md/plugins/discovery/markdown_discovery_plugin.yapsy-plugin b/src/statick_tool/plugins/discovery/markdown_discovery_plugin.yapsy-plugin similarity index 100% rename from src/statick_md/plugins/discovery/markdown_discovery_plugin.yapsy-plugin rename to src/statick_tool/plugins/discovery/markdown_discovery_plugin.yapsy-plugin diff --git a/src/statick_md/plugins/discovery/rst_discovery_plugin.py b/src/statick_tool/plugins/discovery/rst_discovery_plugin.py similarity index 100% rename from src/statick_md/plugins/discovery/rst_discovery_plugin.py rename to src/statick_tool/plugins/discovery/rst_discovery_plugin.py diff --git a/src/statick_md/plugins/discovery/rst_discovery_plugin.yapsy-plugin b/src/statick_tool/plugins/discovery/rst_discovery_plugin.yapsy-plugin similarity index 100% rename from src/statick_md/plugins/discovery/rst_discovery_plugin.yapsy-plugin rename to src/statick_tool/plugins/discovery/rst_discovery_plugin.yapsy-plugin diff --git a/src/statick_md/plugins/tool/__init__.py b/src/statick_tool/plugins/tool/__init__.py similarity index 100% rename from src/statick_md/plugins/tool/__init__.py rename to src/statick_tool/plugins/tool/__init__.py diff --git a/src/statick_md/plugins/tool/markdownlint_tool_plugin.py b/src/statick_tool/plugins/tool/markdownlint_tool_plugin.py similarity index 100% rename from src/statick_md/plugins/tool/markdownlint_tool_plugin.py rename to src/statick_tool/plugins/tool/markdownlint_tool_plugin.py diff --git a/src/statick_md/plugins/tool/markdownlint_tool_plugin.yapsy-plugin b/src/statick_tool/plugins/tool/markdownlint_tool_plugin.yapsy-plugin similarity index 100% rename from src/statick_md/plugins/tool/markdownlint_tool_plugin.yapsy-plugin rename to src/statick_tool/plugins/tool/markdownlint_tool_plugin.yapsy-plugin diff --git a/src/statick_md/plugins/tool/proselint_tool_plugin.py b/src/statick_tool/plugins/tool/proselint_tool_plugin.py similarity index 100% rename from src/statick_md/plugins/tool/proselint_tool_plugin.py rename to src/statick_tool/plugins/tool/proselint_tool_plugin.py diff --git a/src/statick_md/plugins/tool/proselint_tool_plugin.yapsy-plugin b/src/statick_tool/plugins/tool/proselint_tool_plugin.yapsy-plugin similarity index 100% rename from src/statick_md/plugins/tool/proselint_tool_plugin.yapsy-plugin rename to src/statick_tool/plugins/tool/proselint_tool_plugin.yapsy-plugin diff --git a/src/statick_md/plugins/tool/rstcheck_tool_plugin.py b/src/statick_tool/plugins/tool/rstcheck_tool_plugin.py similarity index 100% rename from src/statick_md/plugins/tool/rstcheck_tool_plugin.py rename to src/statick_tool/plugins/tool/rstcheck_tool_plugin.py diff --git a/src/statick_md/plugins/tool/rstcheck_tool_plugin.yapsy-plugin b/src/statick_tool/plugins/tool/rstcheck_tool_plugin.yapsy-plugin similarity index 100% rename from src/statick_md/plugins/tool/rstcheck_tool_plugin.yapsy-plugin rename to src/statick_tool/plugins/tool/rstcheck_tool_plugin.yapsy-plugin diff --git a/src/statick_md/plugins/tool/rstlint_tool_plugin.py b/src/statick_tool/plugins/tool/rstlint_tool_plugin.py similarity index 100% rename from src/statick_md/plugins/tool/rstlint_tool_plugin.py rename to src/statick_tool/plugins/tool/rstlint_tool_plugin.py diff --git a/src/statick_md/plugins/tool/rstlint_tool_plugin.yapsy-plugin b/src/statick_tool/plugins/tool/rstlint_tool_plugin.yapsy-plugin similarity index 100% rename from src/statick_md/plugins/tool/rstlint_tool_plugin.yapsy-plugin rename to src/statick_tool/plugins/tool/rstlint_tool_plugin.yapsy-plugin diff --git a/src/statick_md/plugins/tool/writegood_tool_plugin.py b/src/statick_tool/plugins/tool/writegood_tool_plugin.py similarity index 100% rename from src/statick_md/plugins/tool/writegood_tool_plugin.py rename to src/statick_tool/plugins/tool/writegood_tool_plugin.py diff --git a/src/statick_md/plugins/tool/writegood_tool_plugin.yapsy-plugin b/src/statick_tool/plugins/tool/writegood_tool_plugin.yapsy-plugin similarity index 100% rename from src/statick_md/plugins/tool/writegood_tool_plugin.yapsy-plugin rename to src/statick_tool/plugins/tool/writegood_tool_plugin.yapsy-plugin diff --git a/rsc/.markdownlintrc b/src/statick_tool/rsc/.markdownlintrc similarity index 100% rename from rsc/.markdownlintrc rename to src/statick_tool/rsc/.markdownlintrc diff --git a/rsc/markdownlint-profile.yaml b/src/statick_tool/rsc/markdownlint-profile.yaml similarity index 100% rename from rsc/markdownlint-profile.yaml rename to src/statick_tool/rsc/markdownlint-profile.yaml diff --git a/rsc/md-config.yaml b/src/statick_tool/rsc/md-config.yaml similarity index 100% rename from rsc/md-config.yaml rename to src/statick_tool/rsc/md-config.yaml diff --git a/rsc/md-profile.yaml b/src/statick_tool/rsc/md-profile.yaml similarity index 100% rename from rsc/md-profile.yaml rename to src/statick_tool/rsc/md-profile.yaml diff --git a/rsc/rst-profile.yaml b/src/statick_tool/rsc/rst-profile.yaml similarity index 100% rename from rsc/rst-profile.yaml rename to src/statick_tool/rsc/rst-profile.yaml diff --git a/rsc/rstcheck-profile.yaml b/src/statick_tool/rsc/rstcheck-profile.yaml similarity index 100% rename from rsc/rstcheck-profile.yaml rename to src/statick_tool/rsc/rstcheck-profile.yaml diff --git a/rsc/rstlint-profile.yaml b/src/statick_tool/rsc/rstlint-profile.yaml similarity index 100% rename from rsc/rstlint-profile.yaml rename to src/statick_tool/rsc/rstlint-profile.yaml diff --git a/rsc/writegood-profile.yaml b/src/statick_tool/rsc/writegood-profile.yaml similarity index 100% rename from rsc/writegood-profile.yaml rename to src/statick_tool/rsc/writegood-profile.yaml From 108ba11494fb625fc71009a953f14993da6a4d82 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Wed, 1 Nov 2023 08:01:32 -0700 Subject: [PATCH 08/40] Remove pydocstyle, pycodestyle, flake8, isort from running with tox. We run those tools in other parts of our testing pipeline and use different flags. --- pyproject.toml | 1 + tox.ini | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7277994..cbd07d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,7 @@ test = [ "pytest-cov", "pytest-flake8", "pytest-isort", + "statick", "tox", "tox-gh-actions", ] diff --git a/tox.ini b/tox.ini index 628d18f..7c85ec8 100644 --- a/tox.ini +++ b/tox.ini @@ -36,9 +36,7 @@ setenv = PY_IGNORE_IMPORTMISMATCH = 1 deps = .[test] commands = - pydocstyle ../src/ - pycodestyle --ignore=E203,E501,W503 ../src/ - pytest --flake8 --isort \ + pytest \ --cov=statick_tool.plugins.discovery.markdown_discovery_plugin \ --cov=statick_tool.plugins.discovery.rst_discovery_plugin \ --cov=statick_tool.plugins.tool.markdownlint_tool_plugin \ From 63e4b9e789099e5aed5679aae9489d053bd8ff50 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Wed, 1 Nov 2023 08:12:34 -0700 Subject: [PATCH 09/40] Remove install text files. Each had a single package. They are listed directly in README now. --- README.md | 26 ++++++++++++++++---------- install.txt | 1 - npm-deps.txt | 1 - 3 files changed, 16 insertions(+), 12 deletions(-) delete mode 100644 install.txt delete mode 100644 npm-deps.txt diff --git a/README.md b/README.md index ea7b2bf..26f22e5 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,20 @@ Custom exceptions can be applied the same way they are with ## Table of Contents -* [Installation](#installation) -* [Usage](#usage) -* [Existing Plugins](#existing-plugins) - * [Discovery Plugins](#discovery-plugins) - * [Tool Plugins](#tool-plugins) -* [Contributing](#contributing) - * [Mypy](#mypy) - * [Formatting](#formatting) +- [Statick Markdown Plugins](#statick-markdown-plugins) + - [Table of Contents](#table-of-contents) + - [Installation](#installation) + - [Usage](#usage) + - [Dependency Versions](#dependency-versions) + - [Pip Install](#pip-install) + - [Pip Install and Custom Configuration](#pip-install-and-custom-configuration) + - [Source Install and Custom Configuration](#source-install-and-custom-configuration) + - [Existing Plugins](#existing-plugins) + - [Discovery Plugins](#discovery-plugins) + - [Tool Plugins](#tool-plugins) + - [Contributing](#contributing) + - [Mypy](#mypy) + - [Formatting](#formatting) ## Installation @@ -42,8 +48,8 @@ You can also clone the repository and use it locally. Make sure you install all the dependencies from apt/npm: ```shell -cat install.txt | xargs sudo apt-get install -y -cat npm-deps.txt | xargs sudo npm install -g +sudo apt-get install -y npm +sudo npm install -g markdownlint-cli ``` ### Dependency Versions diff --git a/install.txt b/install.txt deleted file mode 100644 index b235581..0000000 --- a/install.txt +++ /dev/null @@ -1 +0,0 @@ -npm diff --git a/npm-deps.txt b/npm-deps.txt deleted file mode 100644 index ab2dfd7..0000000 --- a/npm-deps.txt +++ /dev/null @@ -1 +0,0 @@ -markdownlint-cli From 45c61ed19de8e884a2feff6795365ad8b8031e52 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Wed, 1 Nov 2023 08:13:41 -0700 Subject: [PATCH 10/40] Add new entry when cleaning untracked files. --- clean.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clean.sh b/clean.sh index 8972b13..4c44f4a 100644 --- a/clean.sh +++ b/clean.sh @@ -1,5 +1,5 @@ #!/bin/bash -rm -rf build/ dist/ output-py* .pytest_cache statick_md.egg-info/ statick_output/* .tox/ +rm -rf build/ .coverage dist/ output-py* .pytest_cache statick_md.egg-info/ statick_output/* .tox/ find . -type d -name .mypy_cache -exec rm -rf {} +; find . -type d -name __pycache__ -exec rm -rf {} +; From 1cbf55e7064ac5fae39e8f0b68250f1792fb507d Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Wed, 1 Nov 2023 08:33:05 -0700 Subject: [PATCH 11/40] Remove unused configurations for flake8 and isort. --- tox.ini | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/tox.ini b/tox.ini index 7c85ec8..aa8a2ab 100644 --- a/tox.ini +++ b/tox.ini @@ -3,24 +3,7 @@ envlist = py38, py39, py310, py311 skip_missing_interpreters = true [pytest] -norecursedirs = .tox - -# To work with black some items must be ignored. -# https://github.com/psf/black#how-black-wraps-lines -[flake8] -exclude = .tox -ignore = E203, E231, W503 -max-line-length = 9000 - -# To work with black a specific configuration is required. -# https://github.com/psf/black#how-black-wraps-lines -[isort] -known_first_party = statick_tool -multi_line_output = 3 -include_trailing_comma = True -force_grid_wrap = 0 -use_parentheses = True -line_length = 88 +norecursedirs = .tox build [gh-actions] python = From 82575a00586641d617e7f47cc6a477493485b26c Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 6 Nov 2023 21:43:34 -0800 Subject: [PATCH 12/40] Minimize --cov flags used for tox. --- tox.ini | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tox.ini b/tox.ini index aa8a2ab..f4a2c5d 100644 --- a/tox.ini +++ b/tox.ini @@ -20,14 +20,10 @@ deps = .[test] commands = pytest \ - --cov=statick_tool.plugins.discovery.markdown_discovery_plugin \ - --cov=statick_tool.plugins.discovery.rst_discovery_plugin \ - --cov=statick_tool.plugins.tool.markdownlint_tool_plugin \ - --cov=statick_tool.plugins.tool.proselint_tool_plugin \ - --cov=statick_tool.plugins.tool.rstlint_tool_plugin \ - --cov=statick_tool.plugins.tool.rstcheck_tool_plugin \ - --cov=statick_tool.plugins.tool.writegood_tool_plugin \ + --cov={toxinidir}/src/statick_tool \ --cov-report term-missing \ --doctest-modules \ + --junit-xml=statick-{envname}-junit.xml \ + --junit-prefix={envname} \ {toxinidir} {posargs} coverage xml From e2f939fb46e6145d93413adff3e4605c88fcdf87 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Wed, 22 Nov 2023 14:53:58 -0800 Subject: [PATCH 13/40] Switch from yapsy to stdlib entry points for plugins. --- pyproject.toml | 16 +++++-- ...rkdown_discovery_plugin.py => markdown.py} | 0 .../markdown_discovery_plugin.yapsy-plugin | 3 -- .../{rst_discovery_plugin.py => rst.py} | 0 .../rst_discovery_plugin.yapsy-plugin | 3 -- ...ownlint_tool_plugin.py => markdownlint.py} | 0 .../markdownlint_tool_plugin.yapsy-plugin | 3 -- ...{proselint_tool_plugin.py => proselint.py} | 0 .../tool/proselint_tool_plugin.yapsy-plugin | 3 -- .../{rstcheck_tool_plugin.py => rstcheck.py} | 0 .../tool/rstcheck_tool_plugin.yapsy-plugin | 3 -- .../{rstlint_tool_plugin.py => rstlint.py} | 0 .../tool/rstlint_tool_plugin.yapsy-plugin | 3 -- ...{writegood_tool_plugin.py => writegood.py} | 0 .../tool/writegood_tool_plugin.yapsy-plugin | 3 -- .../exceptions.yaml | 0 .../invalid_package/test.aux | 0 .../invalid_package/test.cls | 0 .../invalid_package/test.log | 0 .../invalid_package/test.sty | 0 .../test_markdown_discovery_plugin.py | 40 +++++----------- .../valid_package/ignore_this/ignoreme.md | 0 .../valid_package/test.md | 0 .../exceptions.yaml | 0 .../invalid_package/test.aux | 0 .../invalid_package/test.cls | 0 .../invalid_package/test.sty | 0 .../test_rst_discovery_plugin.py | 38 +++++---------- .../valid_package/ignore_this/ignoreme.rst | 0 .../valid_package/test.rst | 0 .../test_markdownlint_tool_plugin.py | 48 +++++++------------ .../valid_package/rsc/.markdownlintrc | 0 .../valid_package/rsc/config.yaml | 0 .../valid_package/test.md | 0 .../valid_package/test_no_issues.md | 0 .../test_proselint_tool_plugin.py | 38 +++++---------- .../valid_package/test.md | 0 .../valid_package/test_no_issues.md | 0 .../test_rstcheck_tool_plugin.py | 46 +++++++----------- .../valid_package/ignore_this/ignoreme.rst | 0 .../valid_package/oddextensionrst.source | 0 .../valid_package/test.rst | 0 .../valid_package/test_no_issues.rst | 0 .../test_rstlint_tool_plugin.py | 38 +++++---------- .../valid_package/ignore_this/ignoreme.rst | 0 .../valid_package/oddextensionrst.source | 0 .../valid_package/test.rst | 0 .../valid_package/test_no_issues.rst | 0 .../test_writegood_tool_plugin.py | 46 +++++++----------- .../valid_package/rsc/config.yaml | 0 .../valid_package/test.md | 0 .../valid_package/test.rst | 0 .../valid_package/test_no_issues.md | 0 tox.ini | 3 +- 54 files changed, 119 insertions(+), 215 deletions(-) rename src/statick_tool/plugins/discovery/{markdown_discovery_plugin.py => markdown.py} (100%) delete mode 100644 src/statick_tool/plugins/discovery/markdown_discovery_plugin.yapsy-plugin rename src/statick_tool/plugins/discovery/{rst_discovery_plugin.py => rst.py} (100%) delete mode 100644 src/statick_tool/plugins/discovery/rst_discovery_plugin.yapsy-plugin rename src/statick_tool/plugins/tool/{markdownlint_tool_plugin.py => markdownlint.py} (100%) delete mode 100644 src/statick_tool/plugins/tool/markdownlint_tool_plugin.yapsy-plugin rename src/statick_tool/plugins/tool/{proselint_tool_plugin.py => proselint.py} (100%) delete mode 100644 src/statick_tool/plugins/tool/proselint_tool_plugin.yapsy-plugin rename src/statick_tool/plugins/tool/{rstcheck_tool_plugin.py => rstcheck.py} (100%) delete mode 100644 src/statick_tool/plugins/tool/rstcheck_tool_plugin.yapsy-plugin rename src/statick_tool/plugins/tool/{rstlint_tool_plugin.py => rstlint.py} (100%) delete mode 100644 src/statick_tool/plugins/tool/rstlint_tool_plugin.yapsy-plugin rename src/statick_tool/plugins/tool/{writegood_tool_plugin.py => writegood.py} (100%) delete mode 100644 src/statick_tool/plugins/tool/writegood_tool_plugin.yapsy-plugin rename tests/discovery/{markdown_discovery_plugin => markdown}/exceptions.yaml (100%) rename tests/discovery/{markdown_discovery_plugin => markdown}/invalid_package/test.aux (100%) rename tests/discovery/{markdown_discovery_plugin => markdown}/invalid_package/test.cls (100%) rename tests/discovery/{markdown_discovery_plugin => markdown}/invalid_package/test.log (100%) rename tests/discovery/{markdown_discovery_plugin => markdown}/invalid_package/test.sty (100%) rename tests/discovery/{markdown_discovery_plugin => markdown}/test_markdown_discovery_plugin.py (67%) rename tests/discovery/{markdown_discovery_plugin => markdown}/valid_package/ignore_this/ignoreme.md (100%) rename tests/discovery/{markdown_discovery_plugin => markdown}/valid_package/test.md (100%) rename tests/discovery/{rst_discovery_plugin => rst}/exceptions.yaml (100%) rename tests/discovery/{rst_discovery_plugin => rst}/invalid_package/test.aux (100%) rename tests/discovery/{rst_discovery_plugin => rst}/invalid_package/test.cls (100%) rename tests/discovery/{rst_discovery_plugin => rst}/invalid_package/test.sty (100%) rename tests/discovery/{rst_discovery_plugin => rst}/test_rst_discovery_plugin.py (73%) rename tests/discovery/{rst_discovery_plugin => rst}/valid_package/ignore_this/ignoreme.rst (100%) rename tests/discovery/{rst_discovery_plugin => rst}/valid_package/test.rst (100%) rename tests/tool/{markdownlint_tool_plugin => markdownlint}/test_markdownlint_tool_plugin.py (82%) rename tests/tool/{markdownlint_tool_plugin => markdownlint}/valid_package/rsc/.markdownlintrc (100%) rename tests/tool/{markdownlint_tool_plugin => markdownlint}/valid_package/rsc/config.yaml (100%) rename tests/tool/{markdownlint_tool_plugin => markdownlint}/valid_package/test.md (100%) rename tests/tool/{markdownlint_tool_plugin => markdownlint}/valid_package/test_no_issues.md (100%) rename tests/tool/{proselint_tool_plugin => proselint}/test_proselint_tool_plugin.py (84%) rename tests/tool/{proselint_tool_plugin => proselint}/valid_package/test.md (100%) rename tests/tool/{proselint_tool_plugin => proselint}/valid_package/test_no_issues.md (100%) rename tests/tool/{rstcheck_tool_plugin => rstcheck}/test_rstcheck_tool_plugin.py (80%) rename tests/tool/{rstcheck_tool_plugin => rstcheck}/valid_package/ignore_this/ignoreme.rst (100%) rename tests/tool/{rstcheck_tool_plugin => rstcheck}/valid_package/oddextensionrst.source (100%) rename tests/tool/{rstcheck_tool_plugin => rstcheck}/valid_package/test.rst (100%) rename tests/tool/{rstcheck_tool_plugin => rstcheck}/valid_package/test_no_issues.rst (100%) rename tests/tool/{rstlint_tool_plugin => rstlint}/test_rstlint_tool_plugin.py (70%) rename tests/tool/{rstlint_tool_plugin => rstlint}/valid_package/ignore_this/ignoreme.rst (100%) rename tests/tool/{rstlint_tool_plugin => rstlint}/valid_package/oddextensionrst.source (100%) rename tests/tool/{rstlint_tool_plugin => rstlint}/valid_package/test.rst (100%) rename tests/tool/{rstlint_tool_plugin => rstlint}/valid_package/test_no_issues.rst (100%) rename tests/tool/{writegood_tool_plugin => writegood}/test_writegood_tool_plugin.py (87%) rename tests/tool/{writegood_tool_plugin => writegood}/valid_package/rsc/config.yaml (100%) rename tests/tool/{writegood_tool_plugin => writegood}/valid_package/test.md (100%) rename tests/tool/{writegood_tool_plugin => writegood}/valid_package/test.rst (100%) rename tests/tool/{writegood_tool_plugin => writegood}/valid_package/test_no_issues.md (100%) diff --git a/pyproject.toml b/pyproject.toml index cbd07d5..5504f53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,9 +17,11 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Software Development :: Testing", ] dependencies = [ + "importlib_metadata", "proselint", "restructuredtext-lint", "rstcheck", @@ -30,19 +32,27 @@ dependencies = [ [tool.setuptools.package-data] statick_tool = [ - "plugins/discovery/*.yapsy-plugin", - "plugins/tool/*.yapsy-plugin", "rsc/*", "rsc/.*", ] +[project.entry-points."statick_tool.plugins.discovery"] +markdown = "statick_tool.plugins.discovery.markdown:MarkdownDiscoveryPlugin" +rst = "statick_tool.plugins.discovery.rst:RstDiscoveryPlugin" + +[project.entry-points."statick_tool.plugins.tool"] +markdownlint = "statick_tool.plugins.tool.markdownlint:MarkdownlintToolPlugin" +proselint = "statick_tool.plugins.tool.proselint:ProselintToolPlugin" +rstcheck = "statick_tool.plugins.tool.rstcheck:RstcheckToolPlugin" +rstlint = "statick_tool.plugins.tool.rstlint:RstlintToolPlugin" +writegood = "statick_tool.plugins.tool.writegood:WriteGoodToolPlugin" + [project.urls] "Homepage" = "https://github.com/sscpac/statick-md" "Bug Tracker" = "https://github.com/sscpac/statick-md/issues" [project.optional-dependencies] test = [ - "backports.tempfile", "coverage", "flake8-pep3101", "flake8<5", # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. diff --git a/src/statick_tool/plugins/discovery/markdown_discovery_plugin.py b/src/statick_tool/plugins/discovery/markdown.py similarity index 100% rename from src/statick_tool/plugins/discovery/markdown_discovery_plugin.py rename to src/statick_tool/plugins/discovery/markdown.py diff --git a/src/statick_tool/plugins/discovery/markdown_discovery_plugin.yapsy-plugin b/src/statick_tool/plugins/discovery/markdown_discovery_plugin.yapsy-plugin deleted file mode 100644 index 9c99fbf..0000000 --- a/src/statick_tool/plugins/discovery/markdown_discovery_plugin.yapsy-plugin +++ /dev/null @@ -1,3 +0,0 @@ -[Core] -Name = Markdown Discovery Plugin -Module = markdown_discovery_plugin diff --git a/src/statick_tool/plugins/discovery/rst_discovery_plugin.py b/src/statick_tool/plugins/discovery/rst.py similarity index 100% rename from src/statick_tool/plugins/discovery/rst_discovery_plugin.py rename to src/statick_tool/plugins/discovery/rst.py diff --git a/src/statick_tool/plugins/discovery/rst_discovery_plugin.yapsy-plugin b/src/statick_tool/plugins/discovery/rst_discovery_plugin.yapsy-plugin deleted file mode 100644 index 1d00ea8..0000000 --- a/src/statick_tool/plugins/discovery/rst_discovery_plugin.yapsy-plugin +++ /dev/null @@ -1,3 +0,0 @@ -[Core] -Name = rst Discovery Plugin -Module = rst_discovery_plugin diff --git a/src/statick_tool/plugins/tool/markdownlint_tool_plugin.py b/src/statick_tool/plugins/tool/markdownlint.py similarity index 100% rename from src/statick_tool/plugins/tool/markdownlint_tool_plugin.py rename to src/statick_tool/plugins/tool/markdownlint.py diff --git a/src/statick_tool/plugins/tool/markdownlint_tool_plugin.yapsy-plugin b/src/statick_tool/plugins/tool/markdownlint_tool_plugin.yapsy-plugin deleted file mode 100644 index c7afe77..0000000 --- a/src/statick_tool/plugins/tool/markdownlint_tool_plugin.yapsy-plugin +++ /dev/null @@ -1,3 +0,0 @@ -[Core] -Name = Markdownlint Tool Plugin -Module = markdownlint_tool_plugin diff --git a/src/statick_tool/plugins/tool/proselint_tool_plugin.py b/src/statick_tool/plugins/tool/proselint.py similarity index 100% rename from src/statick_tool/plugins/tool/proselint_tool_plugin.py rename to src/statick_tool/plugins/tool/proselint.py diff --git a/src/statick_tool/plugins/tool/proselint_tool_plugin.yapsy-plugin b/src/statick_tool/plugins/tool/proselint_tool_plugin.yapsy-plugin deleted file mode 100644 index 5ca6563..0000000 --- a/src/statick_tool/plugins/tool/proselint_tool_plugin.yapsy-plugin +++ /dev/null @@ -1,3 +0,0 @@ -[Core] -Name = Proselint Tool Plugin -Module = proselint_tool_plugin diff --git a/src/statick_tool/plugins/tool/rstcheck_tool_plugin.py b/src/statick_tool/plugins/tool/rstcheck.py similarity index 100% rename from src/statick_tool/plugins/tool/rstcheck_tool_plugin.py rename to src/statick_tool/plugins/tool/rstcheck.py diff --git a/src/statick_tool/plugins/tool/rstcheck_tool_plugin.yapsy-plugin b/src/statick_tool/plugins/tool/rstcheck_tool_plugin.yapsy-plugin deleted file mode 100644 index dbba29d..0000000 --- a/src/statick_tool/plugins/tool/rstcheck_tool_plugin.yapsy-plugin +++ /dev/null @@ -1,3 +0,0 @@ -[Core] -Name = rstcheck Tool Plugin -Module = rstcheck_tool_plugin diff --git a/src/statick_tool/plugins/tool/rstlint_tool_plugin.py b/src/statick_tool/plugins/tool/rstlint.py similarity index 100% rename from src/statick_tool/plugins/tool/rstlint_tool_plugin.py rename to src/statick_tool/plugins/tool/rstlint.py diff --git a/src/statick_tool/plugins/tool/rstlint_tool_plugin.yapsy-plugin b/src/statick_tool/plugins/tool/rstlint_tool_plugin.yapsy-plugin deleted file mode 100644 index cac6ffd..0000000 --- a/src/statick_tool/plugins/tool/rstlint_tool_plugin.yapsy-plugin +++ /dev/null @@ -1,3 +0,0 @@ -[Core] -Name = rstlint Tool Plugin -Module = rstlint_tool_plugin diff --git a/src/statick_tool/plugins/tool/writegood_tool_plugin.py b/src/statick_tool/plugins/tool/writegood.py similarity index 100% rename from src/statick_tool/plugins/tool/writegood_tool_plugin.py rename to src/statick_tool/plugins/tool/writegood.py diff --git a/src/statick_tool/plugins/tool/writegood_tool_plugin.yapsy-plugin b/src/statick_tool/plugins/tool/writegood_tool_plugin.yapsy-plugin deleted file mode 100644 index 91bbd46..0000000 --- a/src/statick_tool/plugins/tool/writegood_tool_plugin.yapsy-plugin +++ /dev/null @@ -1,3 +0,0 @@ -[Core] -Name = WriteGood Tool Plugin -Module = writegood_tool_plugin diff --git a/tests/discovery/markdown_discovery_plugin/exceptions.yaml b/tests/discovery/markdown/exceptions.yaml similarity index 100% rename from tests/discovery/markdown_discovery_plugin/exceptions.yaml rename to tests/discovery/markdown/exceptions.yaml diff --git a/tests/discovery/markdown_discovery_plugin/invalid_package/test.aux b/tests/discovery/markdown/invalid_package/test.aux similarity index 100% rename from tests/discovery/markdown_discovery_plugin/invalid_package/test.aux rename to tests/discovery/markdown/invalid_package/test.aux diff --git a/tests/discovery/markdown_discovery_plugin/invalid_package/test.cls b/tests/discovery/markdown/invalid_package/test.cls similarity index 100% rename from tests/discovery/markdown_discovery_plugin/invalid_package/test.cls rename to tests/discovery/markdown/invalid_package/test.cls diff --git a/tests/discovery/markdown_discovery_plugin/invalid_package/test.log b/tests/discovery/markdown/invalid_package/test.log similarity index 100% rename from tests/discovery/markdown_discovery_plugin/invalid_package/test.log rename to tests/discovery/markdown/invalid_package/test.log diff --git a/tests/discovery/markdown_discovery_plugin/invalid_package/test.sty b/tests/discovery/markdown/invalid_package/test.sty similarity index 100% rename from tests/discovery/markdown_discovery_plugin/invalid_package/test.sty rename to tests/discovery/markdown/invalid_package/test.sty diff --git a/tests/discovery/markdown_discovery_plugin/test_markdown_discovery_plugin.py b/tests/discovery/markdown/test_markdown_discovery_plugin.py similarity index 67% rename from tests/discovery/markdown_discovery_plugin/test_markdown_discovery_plugin.py rename to tests/discovery/markdown/test_markdown_discovery_plugin.py index 27a1c5e..c2c907f 100644 --- a/tests/discovery/markdown_discovery_plugin/test_markdown_discovery_plugin.py +++ b/tests/discovery/markdown/test_markdown_discovery_plugin.py @@ -1,40 +1,26 @@ """Unit tests for the markdown discovery plugin.""" import os +import sys -from yapsy.PluginManager import PluginManager - -import statick_tool -from statick_tool.discovery_plugin import DiscoveryPlugin from statick_tool.exceptions import Exceptions from statick_tool.package import Package -from statick_tool.plugins.discovery.markdown_discovery_plugin import ( - MarkdownDiscoveryPlugin, -) +from statick_tool.plugins.discovery.markdown import MarkdownDiscoveryPlugin + +if sys.version_info < (3, 10): + from importlib_metadata import entry_points +else: + from importlib.metadata import entry_points def test_markdown_plugin_found(): """Test that the plugin manager finds the markdown discovery plugin.""" - manager = PluginManager() - # Get the path to statick_tool/__init__.py, get the directory part, and - # add 'plugins' to that to get the standard plugins dir - manager.setPluginPlaces( - [os.path.join(os.path.dirname(statick_tool.__file__), "plugins")] - ) - manager.setCategoriesFilter( - { - "Discovery": DiscoveryPlugin, - } - ) - manager.collectPlugins() - # Verify that a plugin's get_name() function returns "markdown" - assert any( - plugin_info.plugin_object.get_name() == "markdown" - for plugin_info in manager.getPluginsOfCategory("Discovery") - ) - # While we're at it, verify that a plugin is named markdown Discovery Plugin + discovery_plugins = {} + plugins = entry_points(group="statick_tool.plugins.discovery") + for plugin_type in plugins: + plugin = plugin_type.load() + discovery_plugins[plugin_type.name] = plugin() assert any( - plugin_info.name == "Markdown Discovery Plugin" - for plugin_info in manager.getPluginsOfCategory("Discovery") + plugin.get_name() == "markdown" for _, plugin in list(discovery_plugins.items()) ) diff --git a/tests/discovery/markdown_discovery_plugin/valid_package/ignore_this/ignoreme.md b/tests/discovery/markdown/valid_package/ignore_this/ignoreme.md similarity index 100% rename from tests/discovery/markdown_discovery_plugin/valid_package/ignore_this/ignoreme.md rename to tests/discovery/markdown/valid_package/ignore_this/ignoreme.md diff --git a/tests/discovery/markdown_discovery_plugin/valid_package/test.md b/tests/discovery/markdown/valid_package/test.md similarity index 100% rename from tests/discovery/markdown_discovery_plugin/valid_package/test.md rename to tests/discovery/markdown/valid_package/test.md diff --git a/tests/discovery/rst_discovery_plugin/exceptions.yaml b/tests/discovery/rst/exceptions.yaml similarity index 100% rename from tests/discovery/rst_discovery_plugin/exceptions.yaml rename to tests/discovery/rst/exceptions.yaml diff --git a/tests/discovery/rst_discovery_plugin/invalid_package/test.aux b/tests/discovery/rst/invalid_package/test.aux similarity index 100% rename from tests/discovery/rst_discovery_plugin/invalid_package/test.aux rename to tests/discovery/rst/invalid_package/test.aux diff --git a/tests/discovery/rst_discovery_plugin/invalid_package/test.cls b/tests/discovery/rst/invalid_package/test.cls similarity index 100% rename from tests/discovery/rst_discovery_plugin/invalid_package/test.cls rename to tests/discovery/rst/invalid_package/test.cls diff --git a/tests/discovery/rst_discovery_plugin/invalid_package/test.sty b/tests/discovery/rst/invalid_package/test.sty similarity index 100% rename from tests/discovery/rst_discovery_plugin/invalid_package/test.sty rename to tests/discovery/rst/invalid_package/test.sty diff --git a/tests/discovery/rst_discovery_plugin/test_rst_discovery_plugin.py b/tests/discovery/rst/test_rst_discovery_plugin.py similarity index 73% rename from tests/discovery/rst_discovery_plugin/test_rst_discovery_plugin.py rename to tests/discovery/rst/test_rst_discovery_plugin.py index d8d2e32..52453ea 100644 --- a/tests/discovery/rst_discovery_plugin/test_rst_discovery_plugin.py +++ b/tests/discovery/rst/test_rst_discovery_plugin.py @@ -1,38 +1,26 @@ """Unit tests for the rst discovery plugin.""" import os +import sys -from yapsy.PluginManager import PluginManager - -import statick_tool -from statick_tool.discovery_plugin import DiscoveryPlugin from statick_tool.exceptions import Exceptions from statick_tool.package import Package -from statick_tool.plugins.discovery.rst_discovery_plugin import RstDiscoveryPlugin +from statick_tool.plugins.discovery.rst import RstDiscoveryPlugin + +if sys.version_info < (3, 10): + from importlib_metadata import entry_points +else: + from importlib.metadata import entry_points def test_rst_discovery_plugin_found(): """Test that the plugin manager finds the rst discovery plugin.""" - manager = PluginManager() - # Get the path to statick_tool/__init__.py, get the directory part, and - # add 'plugins' to that to get the standard plugins dir - manager.setPluginPlaces( - [os.path.join(os.path.dirname(statick_tool.__file__), "plugins")] - ) - manager.setCategoriesFilter( - { - "Discovery": DiscoveryPlugin, - } - ) - manager.collectPlugins() - # Verify that a plugin's get_name() function returns "rst" - assert any( - plugin_info.plugin_object.get_name() == "rst" - for plugin_info in manager.getPluginsOfCategory("Discovery") - ) - # While we're at it, verify that a plugin is named rst Discovery Plugin + discovery_plugins = {} + plugins = entry_points(group="statick_tool.plugins.discovery") + for plugin_type in plugins: + plugin = plugin_type.load() + discovery_plugins[plugin_type.name] = plugin() assert any( - plugin_info.name == "rst Discovery Plugin" - for plugin_info in manager.getPluginsOfCategory("Discovery") + plugin.get_name() == "rst" for _, plugin in list(discovery_plugins.items()) ) diff --git a/tests/discovery/rst_discovery_plugin/valid_package/ignore_this/ignoreme.rst b/tests/discovery/rst/valid_package/ignore_this/ignoreme.rst similarity index 100% rename from tests/discovery/rst_discovery_plugin/valid_package/ignore_this/ignoreme.rst rename to tests/discovery/rst/valid_package/ignore_this/ignoreme.rst diff --git a/tests/discovery/rst_discovery_plugin/valid_package/test.rst b/tests/discovery/rst/valid_package/test.rst similarity index 100% rename from tests/discovery/rst_discovery_plugin/valid_package/test.rst rename to tests/discovery/rst/valid_package/test.rst diff --git a/tests/tool/markdownlint_tool_plugin/test_markdownlint_tool_plugin.py b/tests/tool/markdownlint/test_markdownlint_tool_plugin.py similarity index 82% rename from tests/tool/markdownlint_tool_plugin/test_markdownlint_tool_plugin.py rename to tests/tool/markdownlint/test_markdownlint_tool_plugin.py index 465deae..ea89184 100644 --- a/tests/tool/markdownlint_tool_plugin/test_markdownlint_tool_plugin.py +++ b/tests/tool/markdownlint/test_markdownlint_tool_plugin.py @@ -1,20 +1,22 @@ """Unit tests for the markdownlint plugin.""" - import argparse -import os -import subprocess - import mock +import os import pytest -from yapsy.PluginManager import PluginManager +import subprocess +import sys import statick_tool from statick_tool.config import Config from statick_tool.package import Package from statick_tool.plugin_context import PluginContext -from statick_tool.plugins.tool.markdownlint_tool_plugin import MarkdownlintToolPlugin +from statick_tool.plugins.tool.markdownlint import MarkdownlintToolPlugin from statick_tool.resources import Resources -from statick_tool.tool_plugin import ToolPlugin + +if sys.version_info < (3, 10): + from importlib_metadata import entry_points +else: + from importlib.metadata import entry_points def setup_markdownlint_tool_plugin(): @@ -43,27 +45,13 @@ def setup_markdownlint_tool_plugin(): def test_markdownlint_tool_plugin_found(): """Test that the plugin manager can find the markdownlint plugin.""" - manager = PluginManager() - # Get the path to statick_tool/__init__.py, get the directory part, and - # add 'plugins' to that to get the standard plugins dir - manager.setPluginPlaces( - [os.path.join(os.path.dirname(statick_tool.__file__), "plugins")] - ) - manager.setCategoriesFilter( - { - "Tool": ToolPlugin, - } - ) - manager.collectPlugins() - # Verify that a plugin's get_name() function returns "markdownlint" - assert any( - plugin_info.plugin_object.get_name() == "markdownlint" - for plugin_info in manager.getPluginsOfCategory("Tool") - ) - # While we're at it, verify that a plugin is named markdownlint Tool Plugin + plugins = {} + tool_plugins = entry_points(group="statick_tool.plugins.tool") + for plugin_type in tool_plugins: + plugin = plugin_type.load() + plugins[plugin_type.name] = plugin() assert any( - plugin_info.name == "Markdownlint Tool Plugin" - for plugin_info in manager.getPluginsOfCategory("Tool") + plugin.get_name() == "markdownlint" for _, plugin in list(plugins.items()) ) @@ -122,7 +110,7 @@ def test_markdownlint_tool_plugin_parse_invalid(): @mock.patch( - "statick_tool.plugins.tool.markdownlint_tool_plugin.subprocess.check_output" + "statick_tool.plugins.tool.markdownlint.subprocess.check_output" ) def test_markdownlint_tool_plugin_scan_calledprocesserror(mock_subprocess_check_output): """ @@ -151,7 +139,7 @@ def test_markdownlint_tool_plugin_scan_calledprocesserror(mock_subprocess_check_ @mock.patch( - "statick_tool.plugins.tool.markdownlint_tool_plugin.subprocess.check_output" + "statick_tool.plugins.tool.markdownlint.subprocess.check_output" ) def test_markdownlint_tool_plugin_scan_nodejs_error(mock_subprocess_check_output): """ @@ -185,7 +173,7 @@ def test_markdownlint_tool_plugin_scan_nodejs_error(mock_subprocess_check_output @mock.patch( - "statick_tool.plugins.tool.markdownlint_tool_plugin.subprocess.check_output" + "statick_tool.plugins.tool.markdownlint.subprocess.check_output" ) def test_markdownlint_tool_plugin_scan_oserror(mock_subprocess_check_output): """ diff --git a/tests/tool/markdownlint_tool_plugin/valid_package/rsc/.markdownlintrc b/tests/tool/markdownlint/valid_package/rsc/.markdownlintrc similarity index 100% rename from tests/tool/markdownlint_tool_plugin/valid_package/rsc/.markdownlintrc rename to tests/tool/markdownlint/valid_package/rsc/.markdownlintrc diff --git a/tests/tool/markdownlint_tool_plugin/valid_package/rsc/config.yaml b/tests/tool/markdownlint/valid_package/rsc/config.yaml similarity index 100% rename from tests/tool/markdownlint_tool_plugin/valid_package/rsc/config.yaml rename to tests/tool/markdownlint/valid_package/rsc/config.yaml diff --git a/tests/tool/markdownlint_tool_plugin/valid_package/test.md b/tests/tool/markdownlint/valid_package/test.md similarity index 100% rename from tests/tool/markdownlint_tool_plugin/valid_package/test.md rename to tests/tool/markdownlint/valid_package/test.md diff --git a/tests/tool/markdownlint_tool_plugin/valid_package/test_no_issues.md b/tests/tool/markdownlint/valid_package/test_no_issues.md similarity index 100% rename from tests/tool/markdownlint_tool_plugin/valid_package/test_no_issues.md rename to tests/tool/markdownlint/valid_package/test_no_issues.md diff --git a/tests/tool/proselint_tool_plugin/test_proselint_tool_plugin.py b/tests/tool/proselint/test_proselint_tool_plugin.py similarity index 84% rename from tests/tool/proselint_tool_plugin/test_proselint_tool_plugin.py rename to tests/tool/proselint/test_proselint_tool_plugin.py index a014938..fc0f569 100644 --- a/tests/tool/proselint_tool_plugin/test_proselint_tool_plugin.py +++ b/tests/tool/proselint/test_proselint_tool_plugin.py @@ -1,19 +1,21 @@ """Unit tests for the proselint plugin.""" - import argparse import json import os - import pytest -from yapsy.PluginManager import PluginManager +import sys import statick_tool from statick_tool.config import Config from statick_tool.package import Package from statick_tool.plugin_context import PluginContext -from statick_tool.plugins.tool.proselint_tool_plugin import ProselintToolPlugin +from statick_tool.plugins.tool.proselint import ProselintToolPlugin from statick_tool.resources import Resources -from statick_tool.tool_plugin import ToolPlugin + +if sys.version_info < (3, 10): + from importlib_metadata import entry_points +else: + from importlib.metadata import entry_points def setup_proselint_tool_plugin(): @@ -41,27 +43,13 @@ def setup_proselint_tool_plugin(): def test_proselint_tool_plugin_found(): """Test that the plugin manager can find the proselint plugin.""" - manager = PluginManager() - # Get the path to statick_tool/__init__.py, get the directory part, and - # add 'plugins' to that to get the standard plugins dir - manager.setPluginPlaces( - [os.path.join(os.path.dirname(statick_tool.__file__), "plugins")] - ) - manager.setCategoriesFilter( - { - "Tool": ToolPlugin, - } - ) - manager.collectPlugins() - # Verify that a plugin's get_name() function returns "proselint" - assert any( - plugin_info.plugin_object.get_name() == "proselint" - for plugin_info in manager.getPluginsOfCategory("Tool") - ) - # While we're at it, verify that a plugin is named proselint Tool Plugin + plugins = {} + tool_plugins = entry_points(group="statick_tool.plugins.tool") + for plugin_type in tool_plugins: + plugin = plugin_type.load() + plugins[plugin_type.name] = plugin() assert any( - plugin_info.name == "Proselint Tool Plugin" - for plugin_info in manager.getPluginsOfCategory("Tool") + plugin.get_name() == "proselint" for _, plugin in list(plugins.items()) ) diff --git a/tests/tool/proselint_tool_plugin/valid_package/test.md b/tests/tool/proselint/valid_package/test.md similarity index 100% rename from tests/tool/proselint_tool_plugin/valid_package/test.md rename to tests/tool/proselint/valid_package/test.md diff --git a/tests/tool/proselint_tool_plugin/valid_package/test_no_issues.md b/tests/tool/proselint/valid_package/test_no_issues.md similarity index 100% rename from tests/tool/proselint_tool_plugin/valid_package/test_no_issues.md rename to tests/tool/proselint/valid_package/test_no_issues.md diff --git a/tests/tool/rstcheck_tool_plugin/test_rstcheck_tool_plugin.py b/tests/tool/rstcheck/test_rstcheck_tool_plugin.py similarity index 80% rename from tests/tool/rstcheck_tool_plugin/test_rstcheck_tool_plugin.py rename to tests/tool/rstcheck/test_rstcheck_tool_plugin.py index d455f9a..9802490 100644 --- a/tests/tool/rstcheck_tool_plugin/test_rstcheck_tool_plugin.py +++ b/tests/tool/rstcheck/test_rstcheck_tool_plugin.py @@ -1,20 +1,22 @@ """Unit tests for the rstcheck plugin.""" - import argparse -import os -import subprocess - import mock +import os import pytest -from yapsy.PluginManager import PluginManager +import subprocess +import sys import statick_tool from statick_tool.config import Config from statick_tool.package import Package from statick_tool.plugin_context import PluginContext -from statick_tool.plugins.tool.rstcheck_tool_plugin import RstcheckToolPlugin +from statick_tool.plugins.tool.rstcheck import RstcheckToolPlugin from statick_tool.resources import Resources -from statick_tool.tool_plugin import ToolPlugin + +if sys.version_info < (3, 10): + from importlib_metadata import entry_points +else: + from importlib.metadata import entry_points def setup_rstcheck_tool_plugin(): @@ -43,27 +45,13 @@ def setup_rstcheck_tool_plugin(): def test_rstcheck_tool_plugin_found(): """Test that the plugin manager can find the rstcheck plugin.""" - manager = PluginManager() - # Get the path to statick_tool/__init__.py, get the directory part, and - # add 'plugins' to that to get the standard plugins dir - manager.setPluginPlaces( - [os.path.join(os.path.dirname(statick_tool.__file__), "plugins")] - ) - manager.setCategoriesFilter( - { - "Tool": ToolPlugin, - } - ) - manager.collectPlugins() - # Verify that a plugin's get_name() function returns "rstcheck" - assert any( - plugin_info.plugin_object.get_name() == "rstcheck" - for plugin_info in manager.getPluginsOfCategory("Tool") - ) - # While we're at it, verify that a plugin is named rstcheck Tool Plugin + plugins = {} + tool_plugins = entry_points(group="statick_tool.plugins.tool") + for plugin_type in tool_plugins: + plugin = plugin_type.load() + plugins[plugin_type.name] = plugin() assert any( - plugin_info.name == "rstcheck Tool Plugin" - for plugin_info in manager.getPluginsOfCategory("Tool") + plugin.get_name() == "rstcheck" for _, plugin in list(plugins.items()) ) @@ -119,7 +107,7 @@ def test_rstcheck_tool_plugin_parse_invalid(): assert not issues -@mock.patch("statick_tool.plugins.tool.rstcheck_tool_plugin.subprocess.check_output") +@mock.patch("statick_tool.plugins.tool.rstcheck.subprocess.check_output") def test_rstcheck_tool_plugin_scan_calledprocesserror(mock_subprocess_check_output): """ Test what happens when a CalledProcessError is raised (usually means rstcheck hit an error). @@ -146,7 +134,7 @@ def test_rstcheck_tool_plugin_scan_calledprocesserror(mock_subprocess_check_outp assert not issues -@mock.patch("statick_tool.plugins.tool.rstcheck_tool_plugin.subprocess.check_output") +@mock.patch("statick_tool.plugins.tool.rstcheck.subprocess.check_output") def test_rstcheck_tool_plugin_scan_oserror(mock_subprocess_check_output): """ Test what happens when an OSError is raised (usually means rstcheck doesn't exist). diff --git a/tests/tool/rstcheck_tool_plugin/valid_package/ignore_this/ignoreme.rst b/tests/tool/rstcheck/valid_package/ignore_this/ignoreme.rst similarity index 100% rename from tests/tool/rstcheck_tool_plugin/valid_package/ignore_this/ignoreme.rst rename to tests/tool/rstcheck/valid_package/ignore_this/ignoreme.rst diff --git a/tests/tool/rstcheck_tool_plugin/valid_package/oddextensionrst.source b/tests/tool/rstcheck/valid_package/oddextensionrst.source similarity index 100% rename from tests/tool/rstcheck_tool_plugin/valid_package/oddextensionrst.source rename to tests/tool/rstcheck/valid_package/oddextensionrst.source diff --git a/tests/tool/rstcheck_tool_plugin/valid_package/test.rst b/tests/tool/rstcheck/valid_package/test.rst similarity index 100% rename from tests/tool/rstcheck_tool_plugin/valid_package/test.rst rename to tests/tool/rstcheck/valid_package/test.rst diff --git a/tests/tool/rstcheck_tool_plugin/valid_package/test_no_issues.rst b/tests/tool/rstcheck/valid_package/test_no_issues.rst similarity index 100% rename from tests/tool/rstcheck_tool_plugin/valid_package/test_no_issues.rst rename to tests/tool/rstcheck/valid_package/test_no_issues.rst diff --git a/tests/tool/rstlint_tool_plugin/test_rstlint_tool_plugin.py b/tests/tool/rstlint/test_rstlint_tool_plugin.py similarity index 70% rename from tests/tool/rstlint_tool_plugin/test_rstlint_tool_plugin.py rename to tests/tool/rstlint/test_rstlint_tool_plugin.py index fe36a25..5339de4 100644 --- a/tests/tool/rstlint_tool_plugin/test_rstlint_tool_plugin.py +++ b/tests/tool/rstlint/test_rstlint_tool_plugin.py @@ -1,18 +1,20 @@ """Unit tests for the rstlint plugin.""" - import argparse import os - import pytest -from yapsy.PluginManager import PluginManager +import sys import statick_tool from statick_tool.config import Config from statick_tool.package import Package from statick_tool.plugin_context import PluginContext -from statick_tool.plugins.tool.rstlint_tool_plugin import RstlintToolPlugin +from statick_tool.plugins.tool.rstlint import RstlintToolPlugin from statick_tool.resources import Resources -from statick_tool.tool_plugin import ToolPlugin + +if sys.version_info < (3, 10): + from importlib_metadata import entry_points +else: + from importlib.metadata import entry_points def setup_rstlint_tool_plugin(): @@ -40,27 +42,13 @@ def setup_rstlint_tool_plugin(): def test_rstlint_tool_plugin_found(): """Test that the plugin manager can find the rstlint plugin.""" - manager = PluginManager() - # Get the path to statick_tool/__init__.py, get the directory part, and - # add 'plugins' to that to get the standard plugins dir - manager.setPluginPlaces( - [os.path.join(os.path.dirname(statick_tool.__file__), "plugins")] - ) - manager.setCategoriesFilter( - { - "Tool": ToolPlugin, - } - ) - manager.collectPlugins() - # Verify that a plugin's get_name() function returns "rstlint" - assert any( - plugin_info.plugin_object.get_name() == "rstlint" - for plugin_info in manager.getPluginsOfCategory("Tool") - ) - # While we're at it, verify that a plugin is named rstlint Tool Plugin + plugins = {} + tool_plugins = entry_points(group="statick_tool.plugins.tool") + for plugin_type in tool_plugins: + plugin = plugin_type.load() + plugins[plugin_type.name] = plugin() assert any( - plugin_info.name == "rstlint Tool Plugin" - for plugin_info in manager.getPluginsOfCategory("Tool") + plugin.get_name() == "rstlint" for _, plugin in list(plugins.items()) ) diff --git a/tests/tool/rstlint_tool_plugin/valid_package/ignore_this/ignoreme.rst b/tests/tool/rstlint/valid_package/ignore_this/ignoreme.rst similarity index 100% rename from tests/tool/rstlint_tool_plugin/valid_package/ignore_this/ignoreme.rst rename to tests/tool/rstlint/valid_package/ignore_this/ignoreme.rst diff --git a/tests/tool/rstlint_tool_plugin/valid_package/oddextensionrst.source b/tests/tool/rstlint/valid_package/oddextensionrst.source similarity index 100% rename from tests/tool/rstlint_tool_plugin/valid_package/oddextensionrst.source rename to tests/tool/rstlint/valid_package/oddextensionrst.source diff --git a/tests/tool/rstlint_tool_plugin/valid_package/test.rst b/tests/tool/rstlint/valid_package/test.rst similarity index 100% rename from tests/tool/rstlint_tool_plugin/valid_package/test.rst rename to tests/tool/rstlint/valid_package/test.rst diff --git a/tests/tool/rstlint_tool_plugin/valid_package/test_no_issues.rst b/tests/tool/rstlint/valid_package/test_no_issues.rst similarity index 100% rename from tests/tool/rstlint_tool_plugin/valid_package/test_no_issues.rst rename to tests/tool/rstlint/valid_package/test_no_issues.rst diff --git a/tests/tool/writegood_tool_plugin/test_writegood_tool_plugin.py b/tests/tool/writegood/test_writegood_tool_plugin.py similarity index 87% rename from tests/tool/writegood_tool_plugin/test_writegood_tool_plugin.py rename to tests/tool/writegood/test_writegood_tool_plugin.py index c62b70c..5714108 100644 --- a/tests/tool/writegood_tool_plugin/test_writegood_tool_plugin.py +++ b/tests/tool/writegood/test_writegood_tool_plugin.py @@ -1,20 +1,22 @@ """Unit tests for the writegood plugin.""" - import argparse -import os -import subprocess - import mock +import os import pytest -from yapsy.PluginManager import PluginManager +import subprocess +import sys import statick_tool from statick_tool.config import Config from statick_tool.package import Package from statick_tool.plugin_context import PluginContext -from statick_tool.plugins.tool.writegood_tool_plugin import WriteGoodToolPlugin +from statick_tool.plugins.tool.writegood import WriteGoodToolPlugin from statick_tool.resources import Resources -from statick_tool.tool_plugin import ToolPlugin + +if sys.version_info < (3, 10): + from importlib_metadata import entry_points +else: + from importlib.metadata import entry_points def setup_writegood_tool_plugin(): @@ -43,27 +45,13 @@ def setup_writegood_tool_plugin(): def test_writegood_tool_plugin_found(): """Test that the plugin manager can find the writegood plugin.""" - manager = PluginManager() - # Get the path to statick_tool/__init__.py, get the directory part, and - # add 'plugins' to that to get the standard plugins dir - manager.setPluginPlaces( - [os.path.join(os.path.dirname(statick_tool.__file__), "plugins")] - ) - manager.setCategoriesFilter( - { - "Tool": ToolPlugin, - } - ) - manager.collectPlugins() - # Verify that a plugin's get_name() function returns "writegood" - assert any( - plugin_info.plugin_object.get_name() == "writegood" - for plugin_info in manager.getPluginsOfCategory("Tool") - ) - # While we're at it, verify that a plugin is named writegood Tool Plugin + plugins = {} + tool_plugins = entry_points(group="statick_tool.plugins.tool") + for plugin_type in tool_plugins: + plugin = plugin_type.load() + plugins[plugin_type.name] = plugin() assert any( - plugin_info.name == "WriteGood Tool Plugin" - for plugin_info in manager.getPluginsOfCategory("Tool") + plugin.get_name() == "writegood" for _, plugin in list(plugins.items()) ) @@ -173,7 +161,7 @@ def test_writegood_tool_plugin_parse_invalid(): @mock.patch( - "statick_tool.plugins.tool.writegood_tool_plugin.subprocess.check_output" + "statick_tool.plugins.tool.writegood.subprocess.check_output" ) def test_writegood_tool_plugin_scan_calledprocesserror(mock_subprocess_check_output): """ @@ -214,7 +202,7 @@ def test_writegood_tool_plugin_scan_calledprocesserror(mock_subprocess_check_out @mock.patch( - "statick_tool.plugins.tool.writegood_tool_plugin.subprocess.check_output" + "statick_tool.plugins.tool.writegood.subprocess.check_output" ) def test_writegood_tool_plugin_scan_oserror(mock_subprocess_check_output): """ diff --git a/tests/tool/writegood_tool_plugin/valid_package/rsc/config.yaml b/tests/tool/writegood/valid_package/rsc/config.yaml similarity index 100% rename from tests/tool/writegood_tool_plugin/valid_package/rsc/config.yaml rename to tests/tool/writegood/valid_package/rsc/config.yaml diff --git a/tests/tool/writegood_tool_plugin/valid_package/test.md b/tests/tool/writegood/valid_package/test.md similarity index 100% rename from tests/tool/writegood_tool_plugin/valid_package/test.md rename to tests/tool/writegood/valid_package/test.md diff --git a/tests/tool/writegood_tool_plugin/valid_package/test.rst b/tests/tool/writegood/valid_package/test.rst similarity index 100% rename from tests/tool/writegood_tool_plugin/valid_package/test.rst rename to tests/tool/writegood/valid_package/test.rst diff --git a/tests/tool/writegood_tool_plugin/valid_package/test_no_issues.md b/tests/tool/writegood/valid_package/test_no_issues.md similarity index 100% rename from tests/tool/writegood_tool_plugin/valid_package/test_no_issues.md rename to tests/tool/writegood/valid_package/test_no_issues.md diff --git a/tox.ini b/tox.ini index f4a2c5d..f99fc5f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38, py39, py310, py311 +envlist = py38, py39, py310, py311, py312 skip_missing_interpreters = true [pytest] @@ -11,6 +11,7 @@ python = 3.9: py39 3.10: py310 3.11: py311 + 3.12: py312 [testenv] changedir = {toxinidir}/output-{envname} From c51ea5c849b94a4b9b9078b4a8564ad04fc0412c Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Wed, 22 Nov 2023 15:07:41 -0800 Subject: [PATCH 14/40] Use stdlib entry points version of Statick from github for now. --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5504f53..7d06f71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = [ "restructuredtext-lint", "rstcheck", "sphinx", - "statick", + "statick@git+https://github.com/tdenewiler/statick#egg=stdlib-plugins", # Remove URL after Statick release. "types-docutils", ] @@ -64,7 +64,7 @@ test = [ "pytest-cov", "pytest-flake8", "pytest-isort", - "statick", + "statick@git+https://github.com/tdenewiler/statick#egg=stdlib-plugins", # Remove URL after Statick release. "tox", "tox-gh-actions", ] From a569bb7e9760bd25f26b846cc807dc92b341dc90 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 23 Nov 2023 15:01:39 -0800 Subject: [PATCH 15/40] Update github workflow configs. --- .github/workflows/tests.yaml | 30 +++--------------------------- pyproject.toml | 5 ++--- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d09e332..d7a3198 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [macos-latest, ubuntu-20.04, ubuntu-22.04, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 @@ -28,30 +28,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - - uses: actions/cache@v3 - if: startsWith(runner.os, 'Linux') - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - uses: actions/cache@v3 - if: startsWith(runner.os, 'macOS') - with: - path: ~/Library/Caches/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - uses: actions/cache@v3 - if: startsWith(runner.os, 'Windows') - with: - path: ~\AppData\Local\pip\Cache - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- + cache: 'pip' - name: Install dependencies run: | @@ -60,8 +37,7 @@ jobs: python -m pip install .[test] python -m pip install .[docs] - # Have to install newer version from non-apt source due to SSL library compatibility issues. - - name: Install Node and node-based tools (Linux) + - name: Install Node tools (Linux) if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' run: | npm install -g markdownlint-cli diff --git a/pyproject.toml b/pyproject.toml index 7d06f71..b5723df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = [ "restructuredtext-lint", "rstcheck", "sphinx", - "statick@git+https://github.com/tdenewiler/statick#egg=stdlib-plugins", # Remove URL after Statick release. + "statick", "types-docutils", ] @@ -64,13 +64,12 @@ test = [ "pytest-cov", "pytest-flake8", "pytest-isort", - "statick@git+https://github.com/tdenewiler/statick#egg=stdlib-plugins", # Remove URL after Statick release. + "statick", "tox", "tox-gh-actions", ] docs = [ "sphinx==1.7.9", - "travis-sphinx==2.2.1", "yaml-1.3", "yapsy", ] From c52693415419ab1238abb8f041f00e9dac03fed9 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 23 Nov 2023 15:39:01 -0800 Subject: [PATCH 16/40] Update publish workflow. --- .github/workflows/publish.yaml | 46 ++++++++-------------------------- pyproject.toml | 3 --- 2 files changed, 10 insertions(+), 39 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index ba639ce..26a7b5a 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,7 +1,7 @@ --- name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI -on: # NOLINT +on: # NOLINT push: tags: - "*" @@ -10,6 +10,11 @@ jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/statick-md + permissions: + id-token: write steps: - uses: actions/checkout@v3 @@ -18,47 +23,16 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.11" - - - uses: actions/cache@v3 - if: startsWith(runner.os, 'Linux') - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - uses: actions/cache@v3 - if: startsWith(runner.os, 'macOS') - with: - path: ~/Library/Caches/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - uses: actions/cache@v3 - if: startsWith(runner.os, 'Windows') - with: - path: ~\AppData\Local\pip\Cache - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- + cache: 'pip' - name: Install tools run: | - python -m pip install --upgrade setuptools - python -m pip install --upgrade wheel + pip install .[dist] - name: Build a binary wheel and a source tarball run: | - python setup.py sdist bdist_wheel - - - name: Publish distribution 📦 to Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_TEST_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + pip install -q build + python -m build - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index b5723df..f73720c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,8 +62,6 @@ test = [ "pydocstyle", "pytest", "pytest-cov", - "pytest-flake8", - "pytest-isort", "statick", "tox", "tox-gh-actions", @@ -71,5 +69,4 @@ test = [ docs = [ "sphinx==1.7.9", "yaml-1.3", - "yapsy", ] From 208b8935dcfb247856693236bb2d8d9b1e659a1a Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Sat, 25 Nov 2023 18:51:35 -0800 Subject: [PATCH 17/40] Dependency cleanup. --- pyproject.toml | 11 +++++------ tox.ini | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f73720c..035f688 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools"] +requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -54,12 +54,8 @@ writegood = "statick_tool.plugins.tool.writegood:WriteGoodToolPlugin" [project.optional-dependencies] test = [ "coverage", - "flake8-pep3101", - "flake8<5", # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. + "lark", "mock", - "mypy", - "pycodestyle<2.9.0", # Pin until https://github.com/tholo/pytest-flake8/issues/87 is fixed. - "pydocstyle", "pytest", "pytest-cov", "statick", @@ -70,3 +66,6 @@ docs = [ "sphinx==1.7.9", "yaml-1.3", ] + +[tool.isort] +profile = "black" diff --git a/tox.ini b/tox.ini index f99fc5f..f21c33c 100644 --- a/tox.ini +++ b/tox.ini @@ -15,8 +15,6 @@ python = [testenv] changedir = {toxinidir}/output-{envname} -passenv = CI -setenv = PY_IGNORE_IMPORTMISMATCH = 1 deps = .[test] commands = From 71c650fe5c61a1f14b733092e604584f1602a435 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 22 Apr 2024 09:01:31 -0700 Subject: [PATCH 18/40] Update clean script. Pin pytest version. --- clean.sh | 2 +- pyproject.toml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/clean.sh b/clean.sh index 4c44f4a..c23b89d 100644 --- a/clean.sh +++ b/clean.sh @@ -1,5 +1,5 @@ #!/bin/bash -rm -rf build/ .coverage dist/ output-py* .pytest_cache statick_md.egg-info/ statick_output/* .tox/ +rm -rf build/ .coverage dist/ output-py* .pytest_cache statick_md.egg-info/ statick_output/* .tox/ *.log find . -type d -name .mypy_cache -exec rm -rf {} +; find . -type d -name __pycache__ -exec rm -rf {} +; diff --git a/pyproject.toml b/pyproject.toml index 035f688..9157393 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,9 +56,8 @@ test = [ "coverage", "lark", "mock", - "pytest", + "pytest==8.0.0", "pytest-cov", - "statick", "tox", "tox-gh-actions", ] From ef93aed56ab68ba2eaa85c7b3fc99118d661340a Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Tue, 10 Sep 2024 06:00:13 -0700 Subject: [PATCH 19/40] Update GitHub actions versions. Remove __init__.py files from src/ directory as they interfere with those from main Statick repo. --- .github/workflows/tests.yaml | 6 +++--- src/statick_tool/__init__.py | 1 - src/statick_tool/plugins/__init__.py | 1 - src/statick_tool/plugins/discovery/__init__.py | 1 - src/statick_tool/plugins/tool/__init__.py | 1 - 5 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 src/statick_tool/__init__.py delete mode 100644 src/statick_tool/plugins/__init__.py delete mode 100644 src/statick_tool/plugins/discovery/__init__.py delete mode 100644 src/statick_tool/plugins/tool/__init__.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d7a3198..ae0b212 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -18,14 +18,14 @@ jobs: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: '16' - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: 'pip' diff --git a/src/statick_tool/__init__.py b/src/statick_tool/__init__.py deleted file mode 100644 index 5da5b0e..0000000 --- a/src/statick_tool/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Statick tool.""" diff --git a/src/statick_tool/plugins/__init__.py b/src/statick_tool/plugins/__init__.py deleted file mode 100644 index 9e74282..0000000 --- a/src/statick_tool/plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Markdown plugins for Statick.""" diff --git a/src/statick_tool/plugins/discovery/__init__.py b/src/statick_tool/plugins/discovery/__init__.py deleted file mode 100644 index 878179b..0000000 --- a/src/statick_tool/plugins/discovery/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Md file discovery plugins.""" diff --git a/src/statick_tool/plugins/tool/__init__.py b/src/statick_tool/plugins/tool/__init__.py deleted file mode 100644 index ef93d6a..0000000 --- a/src/statick_tool/plugins/tool/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Md tool plugins.""" From f0c3b686923c758fa2c157e690394d81d33f2074 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Tue, 10 Sep 2024 06:07:50 -0700 Subject: [PATCH 20/40] Use stdlib-plugins branch for statick dependency. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9157393..36176b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = [ "restructuredtext-lint", "rstcheck", "sphinx", - "statick", + "statick@git+https://github.com/tdenewiler/statick@stdlib-plugins", "types-docutils", ] From 332e884121271729c5cf38a88a70b998ffa6f5a5 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 14 Oct 2024 20:42:27 -0700 Subject: [PATCH 21/40] Drop Python 3.8, add Python 3.13. --- .github/workflows/tests.yaml | 2 +- pyproject.toml | 4 ++-- tox.ini | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ae0b212..dde721a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [macos-latest, ubuntu-20.04, ubuntu-22.04, windows-latest] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index 36176b7..488429f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,16 +8,16 @@ authors = [{name = "NIWC Pacific"}] description="Statick analysis plugins for Markdown files." version = "0.1.3" readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" license = {text = "CC0-1.0"} classifiers = [ "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Software Development :: Testing", ] dependencies = [ diff --git a/tox.ini b/tox.ini index f21c33c..14ff8b9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38, py39, py310, py311, py312 +envlist = py39, py310, py311, py312, py313 skip_missing_interpreters = true [pytest] @@ -7,11 +7,11 @@ norecursedirs = .tox build [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 [testenv] changedir = {toxinidir}/output-{envname} From 2fd6b26187d3fc170ba4892dc813e8ba3a4d83d9 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 14 Oct 2024 21:05:39 -0700 Subject: [PATCH 22/40] Minor cleanup. --- .github/workflows/tests.yaml | 2 +- clean.sh | 2 +- src/statick_tool/plugins/tool/proselint.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dde721a..5f5ae4d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -45,7 +45,7 @@ jobs: - name: Mypy run: | - mypy --ignore-missing-imports --strict src/ + mypy --ignore-missing-imports --strict src/statick_tool/ - name: Tox run: | diff --git a/clean.sh b/clean.sh index c23b89d..7745be0 100644 --- a/clean.sh +++ b/clean.sh @@ -1,5 +1,5 @@ #!/bin/bash -rm -rf build/ .coverage dist/ output-py* .pytest_cache statick_md.egg-info/ statick_output/* .tox/ *.log +rm -rf build/ .coverage dist/ output-py* .pytest_cache statick_md.egg-info/ statick_output/* .tox/ ./*.log find . -type d -name .mypy_cache -exec rm -rf {} +; find . -type d -name __pycache__ -exec rm -rf {} +; diff --git a/src/statick_tool/plugins/tool/proselint.py b/src/statick_tool/plugins/tool/proselint.py index 54b5c6d..1d6dd39 100644 --- a/src/statick_tool/plugins/tool/proselint.py +++ b/src/statick_tool/plugins/tool/proselint.py @@ -8,6 +8,7 @@ https://github.com/amperser/proselint#checks """ + import json import logging from typing import Any, Dict, List, Optional From 86b67b6ac659cfa9666f8c5deaa4d6ec9439fc42 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 14 Oct 2024 21:08:38 -0700 Subject: [PATCH 23/40] Add ubuntu-24.04. --- .github/workflows/tests.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5f5ae4d..0100e51 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-20.04, ubuntu-22.04, windows-latest] + os: [macos-latest, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-latest] python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: @@ -38,7 +38,7 @@ jobs: python -m pip install .[docs] - name: Install Node tools (Linux) - if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' run: | npm install -g markdownlint-cli npm install -g write-good @@ -57,14 +57,14 @@ jobs: fail_ci_if_error: false - name: Statick Documentation - if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' uses: sscpac/statick-action@v0.9.2 with: profile: documentation.yaml timings: true - name: Self check - if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' uses: sscpac/statick-action@v0.9.2 with: profile: self_check.yaml From 5a41f43c73a71c450d365c4303dd23ff030d1240 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 4 Nov 2024 19:09:42 -0800 Subject: [PATCH 24/40] Ignore proselint type hint warnings about missing attributes. --- src/statick_tool/plugins/tool/proselint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/statick_tool/plugins/tool/proselint.py b/src/statick_tool/plugins/tool/proselint.py index 1d6dd39..110d0c9 100644 --- a/src/statick_tool/plugins/tool/proselint.py +++ b/src/statick_tool/plugins/tool/proselint.py @@ -44,8 +44,8 @@ def scan(self, package: Package, level: str) -> Optional[List[Issue]]: output: Dict[str, Any] = {} for filename in files: with open(filename, encoding="utf8") as fid: - errors = proselint.tools.errors_to_json( - proselint.tools.lint(fid, config=proselint_default) + errors = proselint.tools.errors_to_json( # type: ignore + proselint.tools.lint(fid, config=proselint_default) # type: ignore ) output[filename] = errors From 07102fc47e121377c85a15a1c6b530a9250ef8b2 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 4 Nov 2024 19:20:55 -0800 Subject: [PATCH 25/40] Remove proselint plugin. Not used as far as I know, and causing too many issues with type hints and unit tests. --- README.md | 2 - pyproject.toml | 2 - src/statick_tool/plugins/tool/proselint.py | 102 --------------------- src/statick_tool/rsc/md-config.yaml | 10 -- 4 files changed, 116 deletions(-) delete mode 100644 src/statick_tool/plugins/tool/proselint.py diff --git a/README.md b/README.md index 26f22e5..c1e0572 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,6 @@ reStructuredText | `.rst` Tool | About :--- | :---- [markdownlint][markdownlint] | A Node.js style checker and lint tool for Markdown/CommonMark files. -[proselint][proselint] | A linter for prose. [rstcheck][rstcheck] | Checks syntax of reStructuredText and code blocks nested within it. [rst-lint][rst-lint] | Checks syntax of reStructuredText and code blocks nested within it. [write-good] | Naive linter for English prose. @@ -174,7 +173,6 @@ black src tests ``` [markdownlint]: https://github.com/igorshubovych/markdownlint-cli -[proselint]: https://github.com/amperser/proselint [rstcheck]: https://github.com/myint/rstcheck [rst-lint]: https://github.com/twolfson/restructuredtext-lint [write-good]: https://github.com/btford/write-good diff --git a/pyproject.toml b/pyproject.toml index 488429f..9aa41e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,6 @@ classifiers = [ ] dependencies = [ "importlib_metadata", - "proselint", "restructuredtext-lint", "rstcheck", "sphinx", @@ -42,7 +41,6 @@ rst = "statick_tool.plugins.discovery.rst:RstDiscoveryPlugin" [project.entry-points."statick_tool.plugins.tool"] markdownlint = "statick_tool.plugins.tool.markdownlint:MarkdownlintToolPlugin" -proselint = "statick_tool.plugins.tool.proselint:ProselintToolPlugin" rstcheck = "statick_tool.plugins.tool.rstcheck:RstcheckToolPlugin" rstlint = "statick_tool.plugins.tool.rstlint:RstlintToolPlugin" writegood = "statick_tool.plugins.tool.writegood:WriteGoodToolPlugin" diff --git a/src/statick_tool/plugins/tool/proselint.py b/src/statick_tool/plugins/tool/proselint.py deleted file mode 100644 index 110d0c9..0000000 --- a/src/statick_tool/plugins/tool/proselint.py +++ /dev/null @@ -1,102 +0,0 @@ -"""Apply proselint tool and gather results. - -Website: http://proselint.com/ -Github: https://github.com/amperser/proselint - -The tool uses the default proselint configuration file. -On Ubuntu this is at `~/.config/proselint/config`. - -https://github.com/amperser/proselint#checks -""" - -import json -import logging -from typing import Any, Dict, List, Optional - -import proselint -from proselint.config import default as proselint_default - -from statick_tool.issue import Issue -from statick_tool.package import Package -from statick_tool.tool_plugin import ToolPlugin - - -class ProselintToolPlugin(ToolPlugin): # type: ignore - """Apply proselint tool and gather results.""" - - def get_name(self) -> str: - """Get name of tool.""" - return "proselint" - - def scan(self, package: Package, level: str) -> Optional[List[Issue]]: - """Run tool and gather output.""" - if "md_src" not in package or not package["md_src"]: - return [] - - files: List[str] = [] - if "md_src" in package: - files += package["md_src"] - - # The JSON output does not include the filename so we have to run each file - # one at a time, and store the output along with the filename in a dictionary. - # The filename may be added to JSON output in the future: - # https://github.com/amperser/proselint/issues/355 - output: Dict[str, Any] = {} - for filename in files: - with open(filename, encoding="utf8") as fid: - errors = proselint.tools.errors_to_json( # type: ignore - proselint.tools.lint(fid, config=proselint_default) # type: ignore - ) - output[filename] = errors - - for key, value in output.items(): - logging.debug("%s: %s", key, value) - - with open(self.get_name() + ".log", "w", encoding="utf8") as fid: - for key, value in output.items(): - combined = key + value - fid.write(combined) - - issues: List[Issue] = self.parse_tool_output(output) - return issues - - def parse_tool_output(self, output: Dict[str, Any]) -> List[Issue]: - """Parse tool output and report issues.""" - issues: List[Issue] = [] - for key, value in output.items(): - try: - data = json.loads(value)["data"]["errors"] - except KeyError as ex: - logging.warning("%s exception: %s", self.get_name(), ex) - continue - for item in data: - if ( - "check" not in item - or "line" not in item - or "message" not in item - or "severity" not in item - ): - logging.debug(" Found invalid proselint output: %s", item) - continue - if item["severity"] == "suggestion": - warning_level = "1" - elif item["severity"] == "warning": - warning_level = "3" - elif item["severity"] == "error": - warning_level = "5" - else: - warning_level = "3" - - issue = Issue( - key, - str(item["line"]), - self.get_name(), - item["check"], - warning_level, - item["message"], - None, - ) - - issues.append(issue) - - return issues diff --git a/src/statick_tool/rsc/md-config.yaml b/src/statick_tool/rsc/md-config.yaml index 3362779..b438a96 100644 --- a/src/statick_tool/rsc/md-config.yaml +++ b/src/statick_tool/rsc/md-config.yaml @@ -7,14 +7,6 @@ levels: markdownlint: flags: "" - proselint: - discovery: - markdown: - flags: "" - tool: - proselint: - flags: "" - rst: discovery: rst: @@ -60,8 +52,6 @@ levels: tool: markdownlint: flags: "" - proselint: - flags: "" rstcheck: flags: "" rstlint: From bb3d1334e6e60b5387711247c3c8f4825827cc0d Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 4 Nov 2024 19:25:42 -0800 Subject: [PATCH 26/40] Remove proselint unit tests. --- .../proselint/test_proselint_tool_plugin.py | 159 ------------------ tests/tool/proselint/valid_package/test.md | 6 - .../proselint/valid_package/test_no_issues.md | 3 - 3 files changed, 168 deletions(-) delete mode 100644 tests/tool/proselint/test_proselint_tool_plugin.py delete mode 100644 tests/tool/proselint/valid_package/test.md delete mode 100644 tests/tool/proselint/valid_package/test_no_issues.md diff --git a/tests/tool/proselint/test_proselint_tool_plugin.py b/tests/tool/proselint/test_proselint_tool_plugin.py deleted file mode 100644 index fc0f569..0000000 --- a/tests/tool/proselint/test_proselint_tool_plugin.py +++ /dev/null @@ -1,159 +0,0 @@ -"""Unit tests for the proselint plugin.""" -import argparse -import json -import os -import pytest -import sys - -import statick_tool -from statick_tool.config import Config -from statick_tool.package import Package -from statick_tool.plugin_context import PluginContext -from statick_tool.plugins.tool.proselint import ProselintToolPlugin -from statick_tool.resources import Resources - -if sys.version_info < (3, 10): - from importlib_metadata import entry_points -else: - from importlib.metadata import entry_points - - -def setup_proselint_tool_plugin(): - """Initialize and return an instance of the proselint plugin.""" - arg_parser = argparse.ArgumentParser() - arg_parser.add_argument( - "--show-tool-output", - dest="show_tool_output", - action="store_false", - help="Show tool output", - ) - - resources = Resources( - [ - os.path.join(os.path.dirname(statick_tool.__file__), "plugins"), - os.path.join(os.path.dirname(__file__), "valid_package"), - ] - ) - config = Config(resources.get_file("config.yaml")) - plugin_context = PluginContext(arg_parser.parse_args([]), resources, config) - plugin = ProselintToolPlugin() - plugin.set_plugin_context(plugin_context) - return plugin - - -def test_proselint_tool_plugin_found(): - """Test that the plugin manager can find the proselint plugin.""" - plugins = {} - tool_plugins = entry_points(group="statick_tool.plugins.tool") - for plugin_type in tool_plugins: - plugin = plugin_type.load() - plugins[plugin_type.name] = plugin() - assert any( - plugin.get_name() == "proselint" for _, plugin in list(plugins.items()) - ) - - -def test_proselint_tool_plugin_scan_valid(): - """Integration test: Make sure the proselint output hasn't changed.""" - plugin = setup_proselint_tool_plugin() - if not plugin.command_exists("proselint"): - pytest.skip("Missing proselint executable.") - package = Package( - "valid_package", os.path.join(os.path.dirname(__file__), "valid_package") - ) - package["md_src"] = [ - os.path.join(os.path.dirname(__file__), "valid_package", "test_no_issues.md") - ] - issues = plugin.scan(package, "level") - assert not issues - - -def test_proselint_tool_plugin_scan_missing_src(): - """No issues should be found if no input files are provided.""" - plugin = setup_proselint_tool_plugin() - if not plugin.command_exists("proselint"): - pytest.skip("Missing proselint executable.") - package = Package( - "valid_package", os.path.join(os.path.dirname(__file__), "valid_package") - ) - issues = plugin.scan(package, "level") - assert not issues - - package["md_src"] = [] - issues = plugin.scan(package, "level") - assert not issues - - -def test_proselint_tool_plugin_scan_valid_with_issues(): - """Integration test: Make sure the proselint output hasn't changed.""" - plugin = setup_proselint_tool_plugin() - if not plugin.command_exists("proselint"): - pytest.skip("Missing proselint executable.") - package = Package( - "valid_package", os.path.join(os.path.dirname(__file__), "valid_package") - ) - package["md_src"] = [ - os.path.join(os.path.dirname(__file__), "valid_package", "test.md") - ] - issues = plugin.scan(package, "level") - assert len(issues) == 2 - - -def test_proselint_tool_plugin_parse_valid(): - """Verify that we can parse the expected output of proselint.""" - plugin = setup_proselint_tool_plugin() - output = {} - errors = {"data": {"errors": [{"check": "lexical_illusions.misc", "column": 48, "end": 5231, "extent": 12, "line": 154, "message": "There's a lexical illusion here: a word is repeated.", "replacements": None, "severity": "warning", "start": 5219}]}, "status": "success"} - output["test.md"] = json.dumps(errors) - issues = plugin.parse_tool_output(output) - assert len(issues) == 1 - assert issues[0].filename == "test.md" - assert issues[0].line_number == "154" - assert issues[0].tool == "proselint" - assert issues[0].issue_type == "lexical_illusions.misc" - assert issues[0].severity == "3" - assert issues[0].message == "There's a lexical illusion here: a word is repeated." - - errors = {"data": {"errors": []}, "status": "success"} - output["test.md"] = json.dumps(errors) - issues = plugin.parse_tool_output(output) - assert not issues - - errors = {"data": {"errors": [{"severity": "suggestion", "check": None, "line": None, "message": None}]}, "status": "success"} - output["test.md"] = json.dumps(errors) - issues = plugin.parse_tool_output(output) - assert len(issues) == 1 - assert issues[0].severity == "1" - - errors = {"data": {"errors": [{"severity": "warning", "check": None, "line": None, "message": None}]}, "status": "success"} - output["test.md"] = json.dumps(errors) - issues = plugin.parse_tool_output(output) - assert len(issues) == 1 - assert issues[0].severity == "3" - - errors = {"data": {"errors": [{"severity": "error", "check": None, "line": None, "message": None}]}, "status": "success"} - output["test.md"] = json.dumps(errors) - issues = plugin.parse_tool_output(output) - assert len(issues) == 1 - assert issues[0].severity == "5" - - errors = {"data": {"errors": [{"severity": "not_a_valid_severity", "check": None, "line": None, "message": None}]}, "status": "success"} - output["test.md"] = json.dumps(errors) - issues = plugin.parse_tool_output(output) - assert len(issues) == 1 - assert issues[0].severity == "3" - - -def test_proselint_tool_plugin_parse_invalid(): - """Verify that invalid output of proselint is ignored.""" - plugin = setup_proselint_tool_plugin() - output = {} - errors = {} - output["test.md"] = json.dumps(errors) - issues = plugin.parse_tool_output(output) - assert not issues - - errors = {"data": {"errors": [{}]}, "status": "success"} - output["test.md"] = json.dumps(errors) - issues = plugin.parse_tool_output(output) - assert not issues diff --git a/tests/tool/proselint/valid_package/test.md b/tests/tool/proselint/valid_package/test.md deleted file mode 100644 index fe4b3c1..0000000 --- a/tests/tool/proselint/valid_package/test.md +++ /dev/null @@ -1,6 +0,0 @@ -# Test Markdown file: - - -Hello World. - -This sentence is very unique diff --git a/tests/tool/proselint/valid_package/test_no_issues.md b/tests/tool/proselint/valid_package/test_no_issues.md deleted file mode 100644 index 446f154..0000000 --- a/tests/tool/proselint/valid_package/test_no_issues.md +++ /dev/null @@ -1,3 +0,0 @@ -# Test Markdown file - -Hello World. From 120f844f1b6184e29f0a0aacfe7ad92071a497bd Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 4 Nov 2024 19:34:25 -0800 Subject: [PATCH 27/40] isort formatting --- src/statick_tool/plugins/tool/rstlint.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/statick_tool/plugins/tool/rstlint.py b/src/statick_tool/plugins/tool/rstlint.py index ee1d9db..3649932 100644 --- a/src/statick_tool/plugins/tool/rstlint.py +++ b/src/statick_tool/plugins/tool/rstlint.py @@ -5,7 +5,6 @@ import restructuredtext_lint from docutils.utils import SystemMessage - from statick_tool.issue import Issue from statick_tool.package import Package from statick_tool.tool_plugin import ToolPlugin From 32b4705d6f768c8f44ac8710b42ebff706254b01 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 2 Jan 2025 14:21:52 -0800 Subject: [PATCH 28/40] Update README. --- README.md | 72 +++++++++++++++++++++++-------------------------------- 1 file changed, 30 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index c1e0572..5b9fb5b 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ Custom exceptions can be applied the same way they are with - [Dependency Versions](#dependency-versions) - [Pip Install](#pip-install) - [Pip Install and Custom Configuration](#pip-install-and-custom-configuration) - - [Source Install and Custom Configuration](#source-install-and-custom-configuration) - [Existing Plugins](#existing-plugins) - [Discovery Plugins](#discovery-plugins) - [Tool Plugins](#tool-plugins) @@ -38,24 +37,40 @@ Custom exceptions can be applied the same way they are with The recommended method to install these Statick plugins is via pip: ```shell -python3 -m pip install statick-md +pip install statick-md ``` You can also clone the repository and use it locally. ## Usage -Make sure you install all the dependencies from apt/npm: +Make sure you install all the dependencies from apt/npm. +See for Node/npm installation instructions. + +Configure npm to allow a non-root user to install packages. + +```shell +npm config set prefix '~/.local/' +``` + +Make sure `~/.local/bin` exists. ```shell -sudo apt-get install -y npm -sudo npm install -g markdownlint-cli +mkdir -p ~/.local/bin +echo 'export PATH="$HOME/.local/bin/:$PATH"' >> ~/.bashrc +``` + +Install packages. + +```shell +npm install -g markdownlint-cli +npm install -g write-good ``` ### Dependency Versions Markdownlint-cli has occasionally changed defaults via an upgrade that results in lots of new warnings. -To mitigate this you can pin the version of markdownlint-cli in npm-deps.txt by changing `markdownlint-cli` to `markdownlint-cli@0.19`. +To mitigate this you can pin the version of markdownlint-cli when installing by changing `markdownlint-cli` to `markdownlint-cli@0.19`. ### Pip Install @@ -65,13 +80,12 @@ In that case your directory structure will look like the following: ```shell project-root |- md-project - |- statick-output ``` To run with the default configuration for the statick-md tools use: ```shell -statick md-project/ --output-directory statick-output/ --profile md-profile.yaml --config md-config.yaml +statick md-project/ -o /tmp/statick-output/ --level md --log info ``` ### Pip Install and Custom Configuration @@ -83,40 +97,16 @@ This example will have custom exceptions in the md-project, such that the direct ```shell project-root - |- md-project - |- statick-config - |- rsc - |- exceptions.yaml - |- statick-output +|- md-project + |- statick-config + |- rsc + |- exceptions.yaml ``` For this setup you will run the following: ```shell -statick md-project/ --output-directory statick-output/ --user-paths md-project/statick-config/ --profile md-profile.yaml --config md-config.yaml -``` - -### Source Install and Custom Configuration - -The last type of setup will be to have all of the tools available from cloning repositories, not installing from pip. -The directory structure will look like: - -```shell -project-root - |- md-project - |- statick-config - |- rsc - |- exceptions.yaml - |- statick-output - |- statick - |- statick-md -``` - -Using the example where we want to override the default exceptions with -custom ones in the md-project, the command to run would be: - -```shell -./statick/statick md-project/ --output-directory statick-output/ --user-paths statick-md/,statick-md/src/statick_md,md-project/statick-config/ --profile md-profile.yaml --config md-config.yaml +statick md-project/ --o /tmp/statick-output/ -u md-project/statick-config/ --level md ``` ## Existing Plugins @@ -155,20 +145,18 @@ To determine if proper types are being used in Statick Markdown the following co types of reports that can be viewed with a text editor or web browser. ```shell -python3 -m pip install mypy +pip install mypy mkdir report -mypy --ignore-missing-imports --strict --html-report report/ --txt-report report src +mypy --ignore-missing-imports --strict src ``` -It is hoped that in the future we will generate coverage reports from mypy and use those to check for regressions. - ### Formatting Statick code is formatted using [black](https://github.com/psf/black). To fix locally use ```shell -python3 -m pip install black +pip install black black src tests ``` From ba2793b617b63710fb7195bec4940fb0bd698c80 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Fri, 3 Jan 2025 12:24:04 -0800 Subject: [PATCH 29/40] Simplify pip install command. --- .github/workflows/tests.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0100e51..d749374 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -33,9 +33,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install . - python -m pip install .[test] - python -m pip install .[docs] + pip install .[docs,test] - name: Install Node tools (Linux) if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' From 3c3df43281c57073258563dfa0ac13f585154d47 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Fri, 3 Jan 2025 12:31:06 -0800 Subject: [PATCH 30/40] Update readme. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5b9fb5b..8d35ba0 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ npm config set prefix '~/.local/' ``` Make sure `~/.local/bin` exists. +Check your `PATH` with `echo $PATH`. +If `~/.local/bin` is not listed then add it to your `PATH`. ```shell mkdir -p ~/.local/bin From a01153e42dc7061ea85e93f91508b31eae447e07 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Fri, 3 Jan 2025 16:30:45 -0800 Subject: [PATCH 31/40] Unpin pytest dependency version. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9aa41e5..cc56f43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ test = [ "coverage", "lark", "mock", - "pytest==8.0.0", + "pytest", "pytest-cov", "tox", "tox-gh-actions", From 9db9da9846de443c522c081c7f20fa6674ac8045 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Fri, 3 Jan 2025 17:53:25 -0800 Subject: [PATCH 32/40] Use newer codecov action. --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d749374..9eef5d8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -50,7 +50,7 @@ jobs: python -m tox - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: fail_ci_if_error: false From 27534fa05fb6c8808ca0b18b36642944d2808a16 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Fri, 3 Jan 2025 19:20:55 -0800 Subject: [PATCH 33/40] Bump node version to 20 in CI. --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9eef5d8..3cafcb8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: '16' + node-version: '20' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 From 8b1e4c022d37c8c10f7cb2a46af6baa2680c300f Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Sat, 4 Jan 2025 09:39:50 -0800 Subject: [PATCH 34/40] Adding codecov configuration file to allow lower unit test line coverage percent. --- .codecov.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..c932c22 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,6 @@ +coverage: + status: + project: + default: + target: 25% + threshold: null \ No newline at end of file From 9f5b121e7ab30e55d95a03a2942143f90f37b8a1 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Sat, 4 Jan 2025 15:38:51 -0800 Subject: [PATCH 35/40] Add newline to end of yaml file. --- .codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codecov.yml b/.codecov.yml index c932c22..d74b26c 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -3,4 +3,4 @@ coverage: project: default: target: 25% - threshold: null \ No newline at end of file + threshold: null From ee8610cf4fc2cedcbb231164e0e8dd7ac420b2cb Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Sat, 4 Jan 2025 15:39:29 -0800 Subject: [PATCH 36/40] Be explicit that we are ignoring unit test line coverage for now. --- .codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codecov.yml b/.codecov.yml index d74b26c..dc436e9 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -2,5 +2,5 @@ coverage: status: project: default: - target: 25% + target: 0% threshold: null From 4fffcad2f1977d4307ef4aaf0053d30abb61cada Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 6 Jan 2025 08:54:01 -0800 Subject: [PATCH 37/40] Use runner.os to simplify Linux-specific action steps. --- .github/workflows/tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3cafcb8..deff181 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -36,7 +36,7 @@ jobs: pip install .[docs,test] - name: Install Node tools (Linux) - if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' + if: runner.os == 'Linux' run: | npm install -g markdownlint-cli npm install -g write-good @@ -55,14 +55,14 @@ jobs: fail_ci_if_error: false - name: Statick Documentation - if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' + if: runner.os == 'Linux' uses: sscpac/statick-action@v0.9.2 with: profile: documentation.yaml timings: true - name: Self check - if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' + if: runner.os == 'Linux' uses: sscpac/statick-action@v0.9.2 with: profile: self_check.yaml From beacbeee8b75880d29b87dc47f74e25f9b1eddee Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 9 Jan 2025 07:19:01 -0800 Subject: [PATCH 38/40] Update changelog. --- CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ea01bb..99606d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## Unreleased +### Added + +- Support for Python 3.12 and 3.13. +- Use of `pyproject.toml` instead of `setup.py` and `requirements.txt`. +- Supports new plugin discovery mechanism for the main Statick tool. + - Switched from yapsy to setuptools for plugin mechanism. (sscpac/statick#508) + +### Changed + +- Disabled code coverage requirements in CI for now. + - Unable to get line coverage working with new plugin mechanism. + Unit tests still work to find problems. +- Updated README to use more modern approach to installing Python and NPM packages. + +### Removed + +- No longer support Python 3.8. +- Proselint tool removed. + - Unable to resolve type hint and unit test issues. + Tool not used as far as Statick developers are aware. + ## v0.2.0 - 2025-01-03 ### Removed From ed88d065b92270b6ddafeb50eb1454551dbcc129 Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Thu, 9 Jan 2025 07:21:02 -0800 Subject: [PATCH 39/40] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99606d0..39ffb14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Unable to get line coverage working with new plugin mechanism. Unit tests still work to find problems. - Updated README to use more modern approach to installing Python and NPM packages. +- Rename plugin modules so they are shorter and less redundant. ### Removed From dd3bb873af206338ecd086c491453c5a634adb2f Mon Sep 17 00:00:00 2001 From: Thomas Denewiler Date: Mon, 20 Jan 2025 06:52:02 -0800 Subject: [PATCH 40/40] Use latest statick release as dependency. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cc56f43..7af8fd1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "restructuredtext-lint", "rstcheck", "sphinx", - "statick@git+https://github.com/tdenewiler/statick@stdlib-plugins", + "statick", "types-docutils", ]