- Notifications
You must be signed in to change notification settings - Fork3
gnoverse/tlin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Advance Linter for go-like grammar languages.
tlin is an linter designed for bothGo andgno programming languages. It leverages the functionality ofgolangci-lint as its main linting engine, providing powerful code analysis for go-like grammar languages.
Inspired by Rust'sclippy, tlin aims to provide additional code improvement suggestions beyond the default golangci-lint rules.
- Support for Go (.go) and Gno (.gno) files
- Ability to add custom lint rules
- Additional code improvement suggestion, such as detecting unnecessary code
- Auto-fixing for some lint rules
- Cyclomatic complexity analysis
To install tlin CLI, follow these steps:
git clone https://github.com/gnolang/tlincd tlingo install ./cmd/tlin
tlin<path>
Replace<path>
with the file or directory path you want to analyze.
To check the current directory, run:
tlin.
tlin supports a configuration file (.tlin.yaml
) to customize its behavior. You can generate a default configuration file by running:
tlin -init
This command will create a.tlin.yaml
file in the current directory with the following content:
# .tlin.yamlname:tlinrules:
You can customize the configuration file to enable or disable specific lint rules, set cyclomatic complexity thresholds, and more.
# .tlin.yamlname:tlinrules:useless-break:severity:WARNINGdeprecated-function:severity:OFF
tlin supports several flags to customize its behavior:
-timeout <duration>
: Set a timeout for the linter (default: 5m). Example:-timeout 1m30s
-cyclo
: Run cyclomatic complexity analysis-threshold <int>
: Set cyclomatic complexity threshold (default: 10)-ignore <rules>
: Comma-separated list of lint rules to ignore-ignore-paths <paths>
: Comma-separated list of paths to ignore-cfg
: Run control flow graph analysis-func <name>
: Specify function name for CFG analysis-fix
: Automatically fix issues-dry-run
: Run in dry-run mode (show fixes without applying them)-confidence <float>
: Set confidence threshold for auto-fixing (0.0 to 1.0, default: 0.75)-o <path>
: Write output to a file instead of stdout-json-output
: Output results in JSON format-init
: Initialize a new tlin configuration file in the current directory-c <path>
: Specify a custom configuration file
For detailed contribution guidelines, please refer toCONTRIBUTING.md. We welcome all forms of contributions, including bug reports, feature requests, and pull requests.
- @GodDrinkTeJAVA - Project name (
tlin
) suggestion
This project is distributed under the MIT License. SeeLICENSE
for more information.
About
Advanced Linter for Gno
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.