You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automated linter installation and configuration for consistent code quality across teams and environments.
10
10
11
-
This tool installs well-configured linters to any project, open-source or
12
-
otherwise. The linters can be used in a repeatable and consistent way across CI,
13
-
local tests, and IDE's.
11
+
## Why lint-install?
14
12
15
-
lint-install adds linter configuration to the root of your project, and Makefile
16
-
rules to install a consistently versioned set of linters to be used in any
17
-
environment. These Makefile rules can also be upgrading by lint-install, updating
18
-
all environments simultaneously.
13
+
Maintaining consistent code quality across a team can be challenging. Different developers might use different linters, versions, or configurations, leading to:
14
+
15
+
-**Inconsistent code reviews** - Style debates instead of logic discussions
16
+
-**CI/CD failures** - Code that passes locally but fails in CI due to different linter versions
17
+
-**Configuration drift** - Each project reinventing its own linting setup
18
+
-**Onboarding friction** - New contributors struggling with tooling setup
19
+
20
+
lint-install solves these problems by providing:
21
+
22
+
-**One command setup** - Instantly adds industry-standard linters to any project
23
+
-**Version pinning** - Everyone uses the exact same linter versions
-**Easy updates** - Upgrade all linters across your entire team with one command
26
+
-**Multi-environment support** - Same linting in local development, CI/CD, and IDEs
27
+
28
+
## How it works
29
+
30
+
lint-install adds Makefile rules and linter configurations to your project root. It installs specific versions of well-configured linters that can be used consistently by all contributors, whether they're working locally, in CI, or using an IDE.
19
31
20
32
Currently supported languages:
21
33
22
-
-Go
23
-
- Shell
24
-
- Dockerfile
25
-
- YAML
34
+
-**Go** - golangci-lint with comprehensive checks
35
+
-**Shell** - shellcheck for POSIX compliance and best practices
36
+
-**Dockerfile** - hadolint for security and best practices
37
+
-**YAML** - yamllint for syntax and style
26
38
27
39
## Philosophy
28
40
29
41
- Catch all the bugs!
30
42
- Improve readability as much as possible.
31
43
- Be idiomatic: only raise issues that the language authors would flag
32
44
45
+
## Installation
46
+
47
+
```bash
48
+
go install github.com/codeGROOVE-dev/lint-install@latest
49
+
```
50
+
33
51
## Usage
34
52
35
-
Installation:
53
+
### Basic usage
36
54
37
-
`go get github.com/tinkerbell/lint-install`
55
+
Add linters to your project:
38
56
39
-
Add Makefile rules for a git repository:
57
+
```bash
58
+
lint-install .
59
+
```
60
+
61
+
This creates:
62
+
- Makefile rules for installing and running linters
63
+
- Configuration files for each detected language
64
+
- A `.gitignore` entry for the linter binaries
65
+
66
+
Run the linters:
67
+
68
+
```bash
69
+
make lint
70
+
```
40
71
41
-
`$HOME/go/bin/lint-install <repo>`
72
+
### Examples
42
73
43
-
Users can then lint the project using:
74
+
**Adding linters to a Go project:**
75
+
```bash
76
+
cd my-go-project
77
+
lint-install .
78
+
make lint
79
+
```
44
80
45
-
`make lint`
81
+
**Selective language support:**
82
+
```bash
83
+
# Only add Go and Shell linters, ignore others
84
+
lint-install -dockerfile=ignore -yaml=ignore .
85
+
```
46
86
47
-
Other options:
87
+
**Preview changes without applying:**
88
+
```bash
89
+
lint-install -dry-run .
90
+
```
91
+
92
+
**CI/CD integration:**
93
+
```yaml
94
+
# GitHub Actions example
95
+
- name: Install linters
96
+
run: make lint-install
97
+
98
+
- name: Run linters
99
+
run: make lint
100
+
```
101
+
102
+
**Updating linter versions:**
103
+
```bash
104
+
# Re-run lint-install to update to latest versions
105
+
lint-install .
106
+
git add Makefile .*.version
107
+
git commit -m "Update linter versions"
108
+
```
109
+
110
+
### Command-line options
48
111
49
112
```
50
113
-dockerfile string
@@ -60,3 +123,39 @@ Other options:
60
123
-yaml string
61
124
Level to lint YAML with: [ignore, warn, error] (default "error")
62
125
```
126
+
127
+
### What gets added to your project
128
+
129
+
1.**Makefile targets:**
130
+
-`make lint` - Run all configured linters
131
+
-`make lint-<language>` - Run specific language linter
132
+
-`make lint-install` - Install the linter binaries
133
+
134
+
2.**Configuration files:**
135
+
-`.golangci.yml` - Go linting rules
136
+
-`.hadolint.yaml` - Dockerfile linting rules
137
+
-`.yamllint` - YAML linting rules
138
+
-`.*.version` files - Pinned linter versions
139
+
140
+
3.**Linter binaries:**
141
+
- Installed to `./out/linters/` (git-ignored)
142
+
- Consistent versions across all environments
143
+
144
+
## Features
145
+
146
+
-**Zero configuration** - Sensible defaults that work for most projects
147
+
-**Language detection** - Automatically identifies which linters to install
148
+
-**Version management** - Pins linter versions for reproducible builds
149
+
-**Makefile integration** - Works with existing build systems
150
+
-**Incremental adoption** - Control which languages to lint
151
+
-**IDE friendly** - Linters work with VSCode, GoLand, and other editors
152
+
-**Fast installation** - Downloads pre-built binaries when available
153
+
-**Cross-platform** - Works on Linux, macOS, and Windows
154
+
155
+
## Contributing
156
+
157
+
Contributions are welcome! Please feel free to submit issues or pull requests.
0 commit comments