Skip to main content

jay_lint

Build and Test License: MIT

This is my attempt in making my own linter using Please from Thought Machine and the python ast library

Install it via pip

pip install jay_lint

To install, on the root directory run:

pip install .

How to use?

After installing, simply run jlint followed by your file name. eg:

jlint <test.py>

How to use 'fix'?

Same as before, just add --fix after the file name eg:

jlint --fix <test.py>

TypeScript / JavaScript support

jlint also lints .ts, .tsx, .js, .jsx, .mjs files. It parses them with tree-sitter (installed with the package; needs Python 3.9+):

jlint app/page.tsx                      # one file
jlint app components lib                # directories (node_modules, .next, plz-out skipped)
jlint --fix components/Bio.tsx          # fix in place
jlint --strict --max-line-length 88 app # exit 1 if anything is reported (for CI)
jlint                                   # no arguments: use the paths from the config file

Checks (--fix can fix the ones marked fix):

Check
Import order and blank lines between import groups (builtin, external, @/ internal, parent, sibling, index; alphabetised) fix
Unused imports (default, named, aliased, namespace; side-effect imports are never unused) fix
Trailing whitespace, repeated or leading blank lines, final newline fix
Line length (--max-line-length, default 100). Whole-line // comments and * JSDoc lines that are too long are reported and --fix wraps them at word boundaries (keeping indent and prefix). Lines with a string, template literal, regex, URL, trailing comment, tool directive (eslint-..., @ts-..., prettier-ignore) or aligned columns are not reported, since they cannot be wrapped safely fix (comments)

The import order rules mirror eslint-plugin-import's import/order with alphabetize and newlines-between: always, so the two agree. Imports are only reordered when nothing but imports sits between them; a comment between two imports leaves them alone.

Config file

Put your settings in jlint.toml, or under [tool.jlint] in pyproject.toml, and run plain jlint. The nearest config is found by searching upwards from the current directory (jlint.toml wins over pyproject.toml), or pass one with --config path/to/file.toml.

# jlint.toml
paths = ["app", "components", "lib", "utils"]   # linted when no files are given on the command line
max-line-length = 88                            # TypeScript / JavaScript (default 100)
strict = true                                   # exit 1 if anything is reported
exclude = ["generated", "*.stories.tsx"]        # folder names or paths to skip inside directories

The same settings in pyproject.toml:

[tool.jlint]
paths = ["src"]

paths and exclude are relative to the config file. Command-line arguments override the config: files on the command line replace paths, and --max-line-length replaces max-line-length. Unknown settings and wrong types are reported as errors.

Development (Please)

Tests run under Please, pinned to the Python in .python-version (currently 3.11) so local and CI match. Please builds with its own restricted PATH, so it ignores the python3 on yours; scripts/use_uv_python.sh installs the pinned Python with uv and points Please at it (via an untracked .plzconfig.local).

./scripts/use_uv_python.sh
./pleasew test //src/...

Metadata

Release files for jay-lint 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jay-lint 0.2.0
File Size Uploaded Provenance
jay_lint-0.2.0.tar.gz 15.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for jay-lint 0.2.0
File Interpreter ABI Platform
jay_lint-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.6 kB

Release files / jay_lint-0.2.0.tar.gz

Download URL jay_lint-0.2.0.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3b5812eb28360b5ddf6bd362585c316730e8ef4e927f1a442c19381e34f706cb
BLAKE2b-256 checksum
How to use checksums
bcc59b70caf209469478fd482e31a4558961078e6075de0841cecebf1d6a6b71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Release files / jay_lint-0.2.0-py3-none-any.whl

Download URL jay_lint-0.2.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22cf82e1ba2c62dd170e959189e857b1814d7d0c42a3b1f9c4638f22d4e88d0c
BLAKE2b-256 checksum
How to use checksums
b0ad3b0c1fd7f892ace2628085480f6c561af8ffcc304ff68528ef3f009d111a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Security for jay-lint 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page