Skip to main content

Statick analysis plugins for Markdown files.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Statick Markdown Plugins

Unit Tests PyPI version Codecov Python Versions License Checked with mypy Daily Downloads Weekly Downloads Monthly Downloads

This is a set of plugins for Statick that will discover Markdown (md) files and perform static analysis on those files.

The current plugins will discover Markdown files in a project and can be configured to check those files using

Custom exceptions can be applied the same way they are with Statick exceptions.

Installation

The recommended method to install these Statick plugins is via pip:

python3 -m 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:

cat install.txt | xargs sudo apt-get install -y
cat npm-deps.txt | xargs sudo npm install -g

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.

Pip Install

The most common usage is to use statick and statick-md from pip. In that case your directory structure will look like the following:

  • doc
    • md-project
    • statick-output

To run with the default configuration for the statick-md tools use:

statick md-project/ --output-directory statick-output/ --profile md-profile.yaml

Pip Install and Custom Configuration

There are times when you will want to have a custom Statick configuration. This is usually done to run a different set of tools than are called out in the default profile, or to add exceptions. For this case you will have to add the new Statick configuration somewhere. This example will have custom exceptions in the md-project, such that the directory structure is:

  • doc
    • md-project
      • statick-config
        • rsc
          • exceptions.yaml
    • statick-output

For this setup you will run the following:

statick md-project/ --output-directory statick-output/ --user-paths md-project/statick-config/ --profile md-profile.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:

  • doc
    • 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:

./statick/statick md-project/ --output-directory statick-output/ --user-paths statick-md/,md-project/statick-config/ --profile md-profile.yaml

Tests and Contributing

If you write a new feature for Statick or are fixing a bug, you are strongly encouraged to add unit tests for your contribution. In particular, it is much easier to test whether a bug is fixed (and identify future regressions) if you can add a small unit test which replicates the bug.

Before submitting a change, please run tox to check that you have not introduced any regressions or violated any code style guidelines.

Mypy

Statick Markdown uses mypy to check that type hints are being followed properly. Type hints are described in PEP 484 and allow for static typing in Python. To determine if proper types are being used in Statick Markdown the following command will show any errors, and create several types of reports that can be viewed with a text editor or web browser.

python3 -m pip install mypy
mkdir report
mypy --ignore-missing-imports --strict --html-report report/ --txt-report report 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. To fix locally use

python3 -m pip install black
black src tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

statick-md-0.0.7.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

statick_md-0.0.7-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file statick-md-0.0.7.tar.gz.

File metadata

  • Download URL: statick-md-0.0.7.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for statick-md-0.0.7.tar.gz
Algorithm Hash digest
SHA256 d232313776e0a6859df5a6d4f26d0ff48a1ea7a66aeae5459cc2b776e7b83a19
MD5 f8f9bef13a5c82537698a95b5799535a
BLAKE2b-256 1a58404481ed162dc6092c36f8cfdb2a6ab67b71a4ddf536a3255237ffb8810a

See more details on using hashes here.

File details

Details for the file statick_md-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: statick_md-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for statick_md-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7fa6ed11a3806192338d6143e9695c6c47c7769bb7a5d6049f4d7cc3b572b325
MD5 5df43d57272c93f555e50ac0cd900c51
BLAKE2b-256 fec1f4e88c9566d84251a764481ad4bb31714688878eb63146770040a217d6e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page