|
8 | 8 |
|
9 | 9 | Automated linter installation and configuration for consistent code quality across teams and environments. |
10 | 10 |
|
11 | | -## Why lint-install? |
12 | | - |
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. |
31 | | - |
32 | | -Currently supported languages: |
33 | | - |
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 |
38 | | - |
39 | | -## Philosophy |
40 | | - |
41 | | -- Catch all the bugs! |
42 | | -- Improve readability as much as possible. |
43 | | -- Be idiomatic: only raise issues that the language authors would flag |
44 | | - |
45 | | -## Installation |
| 11 | +## Quick Start |
46 | 12 |
|
47 | 13 | ```bash |
| 14 | +# Install |
48 | 15 | go install github.com/codeGROOVE-dev/lint-install@latest |
49 | | -``` |
50 | | - |
51 | | -## Usage |
52 | | - |
53 | | -### Basic usage |
54 | 16 |
|
55 | | -Add linters to your project: |
56 | | - |
57 | | -```bash |
| 17 | +# Add linters to your project |
58 | 18 | lint-install . |
| 19 | + |
| 20 | +# Run linters |
| 21 | +make lint |
59 | 22 | ``` |
60 | 23 |
|
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 |
| 24 | +## Why Use It? |
65 | 25 |
|
66 | | -Run the linters: |
| 26 | +- **One command setup** - Adds industry-standard linters instantly |
| 27 | +- **Version pinning** - Same linter versions for everyone |
| 28 | +- **Battle-tested configs** - Opinionated rules that catch real bugs |
| 29 | +- **Multi-environment** - Works locally, in CI/CD, and IDEs |
67 | 30 |
|
68 | | -```bash |
69 | | -make lint |
70 | | -``` |
| 31 | +## Supported Languages |
71 | 32 |
|
72 | | -### Examples |
| 33 | +- **Go** - golangci-lint |
| 34 | +- **Shell** - shellcheck |
| 35 | +- **Dockerfile** - hadolint |
| 36 | +- **YAML** - yamllint |
| 37 | + |
| 38 | +## Usage Examples |
73 | 39 |
|
74 | | -**Adding linters to a Go project:** |
75 | 40 | ```bash |
76 | | -cd my-go-project |
| 41 | +# Basic usage |
77 | 42 | lint-install . |
78 | 43 | make lint |
79 | | -``` |
80 | 44 |
|
81 | | -**Selective language support:** |
82 | | -```bash |
83 | | -# Only add Go and Shell linters, ignore others |
| 45 | +# Only Go and Shell linters |
84 | 46 | lint-install -dockerfile=ignore -yaml=ignore . |
85 | | -``` |
86 | 47 |
|
87 | | -**Preview changes without applying:** |
88 | | -```bash |
| 48 | +# Preview changes |
89 | 49 | lint-install -dry-run . |
90 | | -``` |
91 | 50 |
|
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 |
| 51 | +# CI/CD (GitHub Actions) |
| 52 | +- run: make lint-install |
| 53 | +- run: make lint |
100 | 54 | ``` |
101 | 55 |
|
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 |
| 56 | +## Command Options |
111 | 57 |
|
112 | 58 | ``` |
113 | | - -dockerfile string |
114 | | - Level to lint Dockerfile with: [ignore, warn, error] (default "error") |
115 | | - -dry-run |
116 | | - Display changes to make |
117 | | - -go string |
118 | | - Level to lint Go with: [ignore, warn, error] (default "error") |
119 | | - -makefile string |
120 | | - name of Makefile to update (default "Makefile") |
121 | | - -shell string |
122 | | - Level to lint Shell with: [ignore, warn, error] (default "error") |
123 | | - -yaml string |
124 | | - Level to lint YAML with: [ignore, warn, error] (default "error") |
| 59 | +-dockerfile string Dockerfile linting: [ignore, warn, error] (default "error") |
| 60 | +-go string Go linting: [ignore, warn, error] (default "error") |
| 61 | +-shell string Shell linting: [ignore, warn, error] (default "error") |
| 62 | +-yaml string YAML linting: [ignore, warn, error] (default "error") |
| 63 | +-dry-run Preview changes without applying |
| 64 | +-makefile string Makefile name (default "Makefile") |
125 | 65 | ``` |
126 | 66 |
|
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 |
| 67 | +## What Gets Added |
145 | 68 |
|
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 |
| 69 | +- **Makefile targets**: `lint`, `lint-<language>`, `lint-install` |
| 70 | +- **Config files**: `.golangci.yml`, `.hadolint.yaml`, `.yamllint` |
| 71 | +- **Version files**: `.*.version` for reproducible builds |
| 72 | +- **Linter binaries**: `./out/linters/` (git-ignored) |
154 | 73 |
|
155 | 74 | ## Contributing |
156 | 75 |
|
157 | | -Contributions are welcome! Please feel free to submit issues or pull requests. |
| 76 | +Contributions welcome! Submit issues or pull requests. |
158 | 77 |
|
159 | 78 | ## License |
160 | 79 |
|
161 | | -See [LICENSE](LICENSE) for details. |
| 80 | +See [LICENSE](LICENSE) for details. |
0 commit comments