Skip to content

Commit 832fab9

Browse files
authored
Merge pull request #2 from codeGROOVE-dev/newer-tools
Make this an independent fork
2 parents 618eaa9 + 02b6f56 commit 832fab9

File tree

5 files changed

+123
-34
lines changed

5 files changed

+123
-34
lines changed

.golangci.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,3 @@ linters:
376376
rules:
377377
- text: 'shadow: declaration of "err" shadows declaration at'
378378
linters: [govet]
379-
- path: '_test\.go'
380-
linters:
381-
- bodyclose
382-
- dupl
383-
- errcheck
384-
- funlen
385-
- goconst
386-
- gosec
387-
- noctx
388-
- wrapcheck

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# BEGIN: lint-install .
3-
# http://github.com/tinkerbell/lint-install
3+
# http://github.com/codeGROOVE-dev/lint-install
44

55
.PHONY: lint
66
lint: _lint

Makefile.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# BEGIN: lint-install {{.Args}}
3-
# http://github.com/tinkerbell/lint-install
3+
# http://github.com/codeGROOVE-dev/lint-install
44

55
.PHONY: lint
66
lint: _lint

README.md

Lines changed: 120 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,111 @@
33
[![GoReport Widget]][GoReport Status]
44
[![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)](https://github.com/emersion/stability-badges#stable)
55

6-
[GoReport Status]: https://goreportcard.com/report/github.com/tinkerbell/lint-install
7-
[GoReport Widget]: https://goreportcard.com/badge/github.com/tinkerbell/lint-install
6+
[GoReport Status]: https://goreportcard.com/report/github.com/codeGROOVE-dev/lint-install
7+
[GoReport Widget]: https://goreportcard.com/badge/github.com/codeGROOVE-dev/lint-install
88

9-
Idiomatic linters for opinionated projects.
9+
Automated linter installation and configuration for consistent code quality across teams and environments.
1010

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?
1412

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
24+
- **Consistent configuration** - Opinionated, battle-tested linter rules
25+
- **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.
1931

2032
Currently supported languages:
2133

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
2638

2739
## Philosophy
2840

2941
- Catch all the bugs!
3042
- Improve readability as much as possible.
3143
- Be idiomatic: only raise issues that the language authors would flag
3244

45+
## Installation
46+
47+
```bash
48+
go install github.com/codeGROOVE-dev/lint-install@latest
49+
```
50+
3351
## Usage
3452

35-
Installation:
53+
### Basic usage
3654

37-
`go get github.com/tinkerbell/lint-install`
55+
Add linters to your project:
3856

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+
```
4071

41-
`$HOME/go/bin/lint-install <repo>`
72+
### Examples
4273

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+
```
4480

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+
```
4686

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
48111

49112
```
50113
-dockerfile string
@@ -60,3 +123,39 @@ Other options:
60123
-yaml string
61124
Level to lint YAML with: [ignore, warn, error] (default "error")
62125
```
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.
158+
159+
## License
160+
161+
See [LICENSE](LICENSE) for details.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/tinkerbell/lint-install
1+
module github.com/codeGROOVE-dev/lint-install
22

33
go 1.22
44

0 commit comments

Comments
 (0)