A CLI utility for linting and analyzing Tcl code.
Project description
tclint
tclint
is a lint tool for Tcl. It analyzes Tcl source files and reports stylistic and functional errors that may inhibit readability or correctness.
Features
- Checks for common Tcl errors
- Companion formatting utility,
tclfmt
- Usage checks for built-in commands
- Plugin system for usage checks of EDA tool-specific commands, including OpenROAD
- More coming soon!
Getting Started
Install tclint
from PyPI using pipx
(recommended):
pipx install tclint
Or with pip
:
pip install tclint
Run tclint
on a Tcl source file by providing its path as a positional argument:
tclint example.tcl
If the file contains any lint violations, they will be printed and tclint
will return a non-zero exit code. Otherwise, the output will be empty and tclint
will exit successfully.
Example
$ cat example.tcl
puts too many arguments !
puts "unexpected indent"
puts "too many spaces after command"
$ tclint example.tcl
example.tcl:1:1: too many args for puts: got 4, expected no more than 3 [command-args]
example.tcl:2:1: expected indent of 0 spaces, got 2 [indent]
example.tcl:3:5: expected 1 space between words, got 3 [spacing]
Usage
tclint
is a command-line utility. It takes a list of paths as positional arguments, which may either be direct paths to source files, or directories which will be recursively searched for files ending in .tcl
, .sdc
, .xdc
, or .upf
.
Collected files will be checked for lint violations. See the
Violations documentation page for a description of all
lint violations tclint
may report.
Aspects of tclint
's behavior can be controlled by a configuration file. By default, tclint
will look for a file named tclint.toml
or .tclint
in the current working directory (in that order), but a path to an alternate configuration file can be provided using the -c
or --config
flag. See Configuration for documentation on the configuration file.
tclint
includes a plugin system for checking EDA tool-specific commands. See the Plugins documentation page for more info.
Contributing
tclint
welcomes community contributions. The best way to help the project is to open an issue if you find a bug or have a feature request.
PRs are also welcome, but for non-trivial changes please open an issue first to solicit feedback. This helps avoid wasted effort.
Use the following steps to set up tclint
for local development:
$ git clone https://github.com/nmoroze/tclint.git # or URL to fork
$ cd tclint
$ pip install -e .[dev]
Please format, lint, and run tests before submitting changes:
$ black --preview .
$ ./util/pre-commit
License
This project is copyright 2024 Noah Moroze, released under the MIT license.
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 tclint-0.4.1.tar.gz
.
File metadata
- Download URL: tclint-0.4.1.tar.gz
- Upload date:
- Size: 69.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d608f1f4a01ef41ff69b8f434ace926815a2e70d6bc7f4c520c4b93efc848bcf |
|
MD5 | 19186f7f0dedabbbe4b0117530020fbf |
|
BLAKE2b-256 | f2fd5a00b08f86582f887380d0e28abd05f0f914712f28a6ee438c0fadc7c31d |
File details
Details for the file tclint-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: tclint-0.4.1-py3-none-any.whl
- Upload date:
- Size: 52.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a8ae5ca07aa0b6977f834911c02e4122e37daa64f2ce1333e23876c2c5ad1cd |
|
MD5 | b692ec92f119e4e0707cc0c5aad0c9f5 |
|
BLAKE2b-256 | 24b30f7a39d9b4bf637a48547abe3d6501337ca2469c2f2f87d7f292a13ac90d |