Statick analysis plugins for TeX/LaTeX files and projects.
Project description
Statick TeX/LaTeX Plugins
This is a set of plugins for Statick that will discover TeX/LaTeX files and perform static analysis on those files.
The current plugins will discover TeX/LaTeX files in a project and can be configured to check those files using ChkTeX and LaCheck. 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:
pip install statick-tex
You can also clone the repository and use it locally.
Usage
Pip Install
The most common usage is to use statick and statick-tex from pip. In that case your directory structure will look like the following:
- doc
- project
- output
To run with the default configuration for the statick-tex tools use:
statick project/ --output-directory output/ --profile tex-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 project, such that the directory structure is:
- doc
- project
- statick-config
- rsc
- exceptions.yaml
- rsc
- statick-config
- output
- project
For this setup you will run the following:
statick project/ --output-directory output/ --user-paths project/statick-config/ --profile tex-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
- project
- statick-config
- rsc
- exceptions.yaml
- rsc
- statick-config
- output
- statick
- statick-tex
- project
Using the example where we want to override the default exceptions with custom ones in the project, the command to run would be:
./statick/statick project/ --output-directory output --user-paths statick-tex,project/statick-config --profile tex-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 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 plugins 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 --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
pip install black
black src
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file statick-tex-0.3.5.tar.gz
.
File metadata
- Download URL: statick-tex-0.3.5.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8792b605d46fefce5dd03aa0d438be4e452f73ab59f1156fe37651d8c3dab21b |
|
MD5 | d6f9bc78d87bd326e4bd086dcc98eaf6 |
|
BLAKE2b-256 | 7fa53c000fb27e814bd3a5ea2b6ea6f8b4c6bd199df753f83357cb3417c81e14 |
File details
Details for the file statick_tex-0.3.5-py3-none-any.whl
.
File metadata
- Download URL: statick_tex-0.3.5-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f68a87d3dc6c4e7b9e01cc4d5a7c09cb6fbd49773fc421fd7ba6cd5ab6b006e8 |
|
MD5 | d51f6d8092b1f2ba7809457fd1451014 |
|
BLAKE2b-256 | e2e2a22b41d5cda3557dd773f48aa2b3737286b0449c7adba310f259af831921 |