Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
4 changes: 4 additions & 0 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4043,6 +4043,10 @@ issues:
# Default: false
new: true

# Show only new issues created after the best common ancestor (merge-base against HEAD).
# Default: ""
new-from-merge-base: main

# Show only new issues created after git revision `REV`.
# Default: ""
new-from-rev: HEAD
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require (
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d
github.com/golangci/misspell v0.6.0
github.com/golangci/plugin-module-register v0.1.1
github.com/golangci/revgrep v0.7.0
github.com/golangci/revgrep v0.8.0
github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed
github.com/gordonklaus/ineffassign v0.1.0
github.com/gostaticanalysis/forcetypeassert v0.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions jsonschema/golangci.next.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4081,6 +4081,10 @@
"type": "boolean",
"default": false
},
"new-from-merge-base": {
"description": "Show only new issues created after the best common ancestor (merge-base against HEAD).",
"type": "string"
},
"new-from-rev": {
"description": "Show only new issues created after this git revision.",
"type": "string"
Expand Down
1 change: 1 addition & 0 deletions pkg/config/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ type Issues struct {
UniqByLine bool `mapstructure:"uniq-by-line"`

DiffFromRevision string `mapstructure:"new-from-rev"`
DiffFromMergeBase string `mapstructure:"new-from-merge-base"`
DiffPatchFilePath string `mapstructure:"new-from-patch"`
WholeFiles bool `mapstructure:"whole-files"`
Diff bool `mapstructure:"new"`
Expand Down
5 changes: 4 additions & 1 deletion pkg/result/processors/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var _ Processor = (*Diff)(nil)
type Diff struct {
onlyNew bool
fromRev string
fromMergeBase string
patchFilePath string
wholeFiles bool
patch string
Expand All @@ -36,6 +37,7 @@ func NewDiff(cfg *config.Issues) *Diff {
return &Diff{
onlyNew: cfg.Diff,
fromRev: cfg.DiffFromRevision,
fromMergeBase: cfg.DiffFromMergeBase,
patchFilePath: cfg.DiffPatchFilePath,
wholeFiles: cfg.WholeFiles,
patch: os.Getenv(envGolangciDiffProcessorPatch),
Expand All @@ -47,7 +49,7 @@ func (*Diff) Name() string {
}

func (p *Diff) Process(issues []result.Issue) ([]result.Issue, error) {
if !p.onlyNew && p.fromRev == "" && p.patchFilePath == "" && p.patch == "" {
if !p.onlyNew && p.fromRev == "" && p.fromMergeBase == "" && p.patchFilePath == "" && p.patch == "" {
return issues, nil
}

Expand All @@ -68,6 +70,7 @@ func (p *Diff) Process(issues []result.Issue) ([]result.Issue, error) {
checker := revgrep.Checker{
Patch: patchReader,
RevisionFrom: p.fromRev,
MergeBase: p.fromMergeBase,
WholeFiles: p.wholeFiles,
}

Expand Down
Loading