Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
62ba04e
chore: improve gitignore
ldez Oct 1, 2025
bdfb442
chore: split into packages and rename symbols
ldez Sep 18, 2025
3e01dfa
chore: update generator
ldez Sep 18, 2025
2261a79
chore: update Makefile
ldez Sep 18, 2025
d7ebee3
chore: improve golangci-lint configuration
ldez Sep 18, 2025
afe8e07
chore: clean CI workflows
ldez Sep 18, 2025
72bfb55
chore: rename _fixtures to testdata
ldez Sep 18, 2025
0184ef5
chore: rename __exp.go to .go.golden
ldez Sep 18, 2025
4e1f7e4
chore: replace logrus with slog
ldez Sep 18, 2025
0ffd263
feat: improve skip files
ldez Sep 18, 2025
f32ffd5
chore: refactor shortener tests
ldez Sep 18, 2025
91e4434
chore: update dependencies
ldez Sep 18, 2025
a5ad16f
chore: linting and cleaning
ldez Sep 18, 2025
81f8294
chore: goreleaser configuration minor changes
ldez Sep 18, 2025
f41d6d9
chore: refactor and add tests
ldez Sep 18, 2025
23cc5ac
chore: refactor main
ldez Sep 18, 2025
55e14af
chore: new module name
ldez Oct 2, 2025
9cf47a1
fix: struct tag raw litteral
ldez Sep 19, 2025
d78634a
chore: move .gitattributes
ldez Sep 19, 2025
9d6634d
feat: improve CLI performance
ldez Sep 20, 2025
b305ce9
chore: isolate executable formatter
ldez Sep 20, 2025
f158471
chore: move IgnoreGenerated from Shortener to main
ldez Sep 20, 2025
f3844f5
fix: use the right regexp for directives
ldez Sep 20, 2025
1b2cb2b
chore: use goimports as a lib instead of CLI
ldez Sep 21, 2025
61e2780
chore: better way to handle the logger
ldez Sep 21, 2025
d8fe0ab
chore: optimisation of the non-line-length-aware formatting
ldez Sep 21, 2025
bd0b256
chore: add NewDefaultConfig
ldez Sep 21, 2025
f4df222
chore: linting
ldez Sep 22, 2025
2a7a297
fix: duplicated structtag keys
ldez Sep 30, 2025
2135cfe
chore: rename HasMultiKeyTags
ldez Oct 1, 2025
f9fbfef
chore: annotations as directives
ldez Oct 1, 2025
5fa2954
fix: improve block of fields detection
ldez Sep 30, 2025
e2ee0b6
chore: improve version display
ldez Oct 1, 2025
a343924
refactor: methods to functions
ldez Oct 1, 2025
e9f2adb
fix: wrong diff
ldez Oct 1, 2025
4ff5bb7
fix: use `-l` and `-w` at the same time
ldez Oct 1, 2025
4cee473
fix: generated file detection inside package clause
ldez Oct 1, 2025
ef6576e
docs: update readme
ldez Sep 18, 2025
3d506ec
chore: improve diff
ldez Oct 2, 2025
1baa936
chore: improve output handling
ldez Oct 2, 2025
fe110c6
chore: rename package shortener to shorten
ldez Oct 2, 2025
7c62e84
chore: shortener config as pointer
ldez Oct 3, 2025
0f7bdc6
chore: improve HasRecursive
ldez Oct 4, 2025
075b453
chore: minor changes
ldez Oct 4, 2025
8279889
fix: ifStmt.Init
ldez Oct 5, 2025
d104b7a
docs: reorganize readme
ldez Oct 5, 2025
6ea00b5
docs: update readme about vscode
ldez Oct 5, 2025
23841f8
docs: reorganize readme
ldez Oct 5, 2025
3106999
chore: add dependabot
ldez Oct 5, 2025
eae5e09
chore: update goreleaser configuration
ldez Oct 5, 2025
1603944
chore: add security policy
ldez Oct 5, 2025
020fab6
chore: set up GitHub templates
ldez Oct 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

71 changes: 71 additions & 0 deletions .github/DISCUSSION_TEMPLATE/ideas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#name: 💡 Feature request
#description: "Suggest an idea for this project."
body:

- type: checkboxes
id: terms
attributes:
label: Welcome
options:
- label: Yes, I've searched similar [ideas on GitHub](https://github.com/golangci/golines/discussions/categories/ideas) and didn't find any.
required: true
- label: I agree to follow this project's [Code of Conduct](https://github.com/golangci/golines?tab=coc-ov-file)
required: true

- type: dropdown
id: install
attributes:
label: How did you install golines?
options:
- I don't know
- Official binary
- Brew
- MacPorts
- Chocolatey
- Scoop
- Docker
- go install
- Tools pattern
- go tool
- AUR
- Nix
- Deb
- RPM
- Other Linux package manager
- Via editor/IDE
- asdf/mise-en-place
- Other
validations:
required: true

- type: textarea
id: problem
attributes:
label: Your feature request related to a problem? Please describe
placeholder: "A clear and concise description of what the problem is."
validations:
required: true

- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
placeholder: "A clear and concise description of what you want to happen."
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
placeholder: "A clear and concise description of any alternative solutions or features you've considered."
validations:
required: true

- type: textarea
id: additional
attributes:
label: Additional context
placeholder: "Add any other context or screenshots about the feature request here."
validations:
required: false
112 changes: 112 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: 🐞 Bug Report
description: "Create a report to help us improve."
labels: [bug]
body:
- type: checkboxes
id: terms
attributes:
label: Welcome
options:
- label: Yes, I'm using a binary release within 2 latest [releases](https://github.com/golangci/golines/releases). Only such installations are supported.
required: true
- label: Yes, I've searched similar [issues on GitHub](https://github.com/golangci/golines/issues) and didn't find any.
required: true
- label: I agree to follow this project's [Code of Conduct](https://github.com/golangci/golines?tab=coc-ov-file)
required: true

- type: dropdown
id: install
attributes:
label: How did you install golines?
options:
- I don't know
- Official binary
- Brew
- MacPorts
- Chocolatey
- Scoop
- Docker
- go install
- Tools pattern
- go tool
- AUR
- Nix
- Deb
- RPM
- Other Linux package manager
- Via editor/IDE
- asdf/mise-en-place
- Other
validations:
required: true

- type: textarea
id: problem
attributes:
label: Description of the problem
placeholder: Your problem description
validations:
required: true

- type: textarea
id: version
attributes:
label: Version of golines
value: |-
<details>

```console
$ golines --version
# Paste output here
```

</details>
validations:
required: true

- type: textarea
id: go-env
attributes:
label: Go environment
value: |-
<details>

```console
$ go version && go env
# paste output here
```

</details>
validations:
required: true

- type: textarea
id: code-example
attributes:
label: A minimal reproducible example or link to a public repository
description: if your problem is related to a private repository, a minimal reproducible example is required.
value: |-
<details>

```go
// add your code here
```

</details>
validations:
required: true

- type: checkboxes
id: validation
attributes:
label: Validation
options:
- label: Yes, I've included all the information above (version, etc.).
required: true

- type: checkboxes
id: supporter
attributes:
label: Supporter
options:
- label: I am a [sponsor/backer](https://golangci-lint.run/docs/donate/)
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Feature request
url: https://github.com/golangci/golines/discussions/new?category=ideas
about: Suggest an idea for this project.
- name: ❓ Questions
url: https://github.com/golangci/golines/discussions/new?category=q-a
about: If you have a question or are looking for advice, please post on our Discussions forum!
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2

updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
day: "sunday"
time: "11:00" # 11am UTC
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
groups:
github-actions:
patterns:
- "*" # Group all updates into a single larger pull request.
14 changes: 14 additions & 0 deletions .github/security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Security Policy

## Supported Versions

We only support the latest version of golines with the two most recent minor versions of Go.

## Reporting a Vulnerability

To report a potential security vulnerability, please create a [security advisory](https://github.com/golangci/golines/security/advisories/new).

For us to respond to your report most effectively, please include any of the following:

- Steps to reproduce or a proof-of-concept
- Any relevant information, including the versions used
29 changes: 19 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,35 @@ name: build

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

permissions:
contents: read

jobs:
goreleaser:
# using Ubuntu 22.04 should help maximize the
# glibc compatibility across the board
# without using a too-old-to-support version
# of Ubuntu.
runs-on: ubuntu-22.04
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v5
- uses: actions/setup-go@v6
with:
go-version: "1.24"
cache: false
- name: build golines
go-version: stable

- name: Check and get dependencies
run: |
go mod tidy
git diff --exit-code go.mod
git diff --exit-code go.sum

- name: Build with goreleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
Expand Down
30 changes: 21 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
name: lint

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

permissions:
contents: read

jobs:
golangci:
name: golines lint
lint:
name: Inception and Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v5
- uses: actions/setup-go@v6
with:
go-version: "1.24"
cache: false
- name: run golangci-lint
uses: golangci/golangci-lint-action@v8
go-version: stable

- name: Check and get dependencies
run: go mod tidy

# Note(ldez): there is no exit code if there is a diff. (same thing with `-w`)
- name: Inception
run: go run . .

- uses: golangci/golangci-lint-action@v8
with:
version: latest
install-mode: binary
skip-cache: true
12 changes: 3 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,15 @@ permissions:

jobs:
goreleaser:
# using Ubuntu 22.04 should help maximize the
# glibc compatibility across the board
# without using a too-old-to-support version
# of Ubuntu.
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "1.24"
cache: false
- name: release golines
uses: goreleaser/goreleaser-action@v6
go-version: stable
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
name: test

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
go:
- "1.23"
- "1.24"
- "1.25"
go-version: [stable, oldstable]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
name: golines test (using go ${{ matrix.go }} on ${{ matrix.os }})
name: Run tests
steps:
- uses: actions/checkout@v5
- name: test golines
uses: actions/setup-go@v5
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
cache: true
go-version: ${{ matrix.go-version }}

- name: Check and get dependencies
run: go mod tidy

- run: make test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

vendor
.vscode
.idea
golines

coverage.out
Loading
Loading