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 documentation related files and perform static analysis on those files.

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

Table of Contents

Deprecated

This set of plugins was merged into the main Statick repository and Python package. All future development will happen in that repository.

Installation

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

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. See https://github.com/nodesource/distributions for Node/npm installation instructions.

Configure npm to allow a non-root user to install packages.

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.

mkdir -p ~/.local/bin
echo 'export PATH="$HOME/.local/bin/:$PATH"' >> ~/.bashrc

Install packages.

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 when installing 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:

project-root
 |- md-project

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

statick md-project/ -o /tmp/statick-output/ --level md --log info

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:

project-root
|- md-project
    |- statick-config
        |- rsc
            |- exceptions.yaml

For this setup you will run the following:

statick md-project/ --o /tmp/statick-output/ -u md-project/statick-config/ --level md

Existing Plugins

Discovery Plugins

File Type Extensions
markdown .md
reStructuredText .rst

Tool Plugins

Tool About
markdownlint A Node.js style checker and lint tool for Markdown/CommonMark files.
rstcheck Checks syntax of reStructuredText and code blocks nested within it.
rst-lint Checks syntax of reStructuredText and code blocks nested within it.
write-good Naive linter for English prose.

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.

pip install mypy
mkdir report
mypy --ignore-missing-imports --strict src

Formatting

Statick code is formatted using black. To fix locally use

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.4.0.tar.gz (9.9 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.4.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file statick_md-0.4.0.tar.gz.

File metadata

  • Download URL: statick_md-0.4.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for statick_md-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b75c6b9d941dfe74dcff3e0f5da2780270effaf35f18b2e091b5e53dbb7d3c65
MD5 0a535414fb56f278c1e5465444eaed18
BLAKE2b-256 359724d16f9880bbc4e6dfe12bc85b4015986ff82d5a18668e4c0f28469cf0a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: statick_md-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for statick_md-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf03ad708eaa0a3309886b21592407d5b1729ee336e7dd781c1ae2edf25c2e06
MD5 1bfda979105c06523a405a3336ebe361
BLAKE2b-256 e975ab4f3c5873de802875731bd3751cfc2304e9178c96988f210ff915052612

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