From 0e985989eca7508667c8456c9457021ab80c1fc1 Mon Sep 17 00:00:00 2001 From: Vasilii Bliznetsov Date: Sun, 17 May 2026 13:18:48 +0300 Subject: [PATCH 1/2] config breaking check --- example.easyp.yaml | 2 ++ internal/config/breaking_check.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/example.easyp.yaml b/example.easyp.yaml index 9f3a0e75..d501b6a3 100644 --- a/example.easyp.yaml +++ b/example.easyp.yaml @@ -18,6 +18,8 @@ breaking: ignore: - some_dir against_git_ref: master + use: + - FILES_CHECK generate: inputs: diff --git a/internal/config/breaking_check.go b/internal/config/breaking_check.go index 46f8fbd7..13bc3fb2 100644 --- a/internal/config/breaking_check.go +++ b/internal/config/breaking_check.go @@ -4,5 +4,6 @@ package config type BreakingCheck struct { Ignore []string `json:"ignore,omitempty" yaml:"ignore,omitempty"` // git ref to compare with - AgainstGitRef string `json:"against_git_ref,omitempty" yaml:"against_git_ref,omitempty"` + AgainstGitRef string `json:"against_git_ref,omitempty" yaml:"against_git_ref,omitempty"` + Use []string `json:"use,omitempty" yaml:"use,omitempty"` } From eb97a51877370eaeefad78470bb70c7845095bf8 Mon Sep 17 00:00:00 2001 From: Vasilii Bliznetsov Date: Sun, 17 May 2026 15:41:19 +0300 Subject: [PATCH 2/2] config breaking check --- internal/api/temporaly_helper.go | 4 ++++ internal/core/breaking_check.go | 8 ++++++++ internal/core/breaking_checker.go | 2 ++ 3 files changed, 14 insertions(+) diff --git a/internal/api/temporaly_helper.go b/internal/api/temporaly_helper.go index b61f059a..f7c2847e 100644 --- a/internal/api/temporaly_helper.go +++ b/internal/api/temporaly_helper.go @@ -7,6 +7,7 @@ import ( "log/slog" "os" "path/filepath" + "slices" "strings" "github.com/samber/lo" @@ -95,9 +96,12 @@ func buildCore(_ context.Context, log logger.Logger, cfg config.Config, dirWalke linterIgnoreDirs := append(cfg.Lint.Ignore, vendorPath) breakingCheckIgnoreDirs := append(cfg.BreakingCheck.Ignore, vendorPath) + filesCheck := slices.Contains(cfg.BreakingCheck.Use, core.BreakingCheckFilesCheck) + breakingCheckConfig := core.BreakingCheckConfig{ IgnoreDirs: breakingCheckIgnoreDirs, AgainstGitRef: cfg.BreakingCheck.AgainstGitRef, + FilesCheck: filesCheck, } // Convert managed mode configuration diff --git a/internal/core/breaking_check.go b/internal/core/breaking_check.go index ac6242fb..3cf49b94 100644 --- a/internal/core/breaking_check.go +++ b/internal/core/breaking_check.go @@ -15,11 +15,17 @@ import ( var ErrRootOutsideProject = fmt.Errorf("breaking check root must be inside the git repository") +const ( + BreakingCheckFilesCheck string = "FILES_CHECK" +) + type BreakingCheckConfig struct { // branch name to compare with AgainstGitRef string // dirs should be ignored IgnoreDirs []string + + FilesCheck bool } func (c *Core) BreakingCheck(ctx context.Context, projectRoot, workingDir, path string) ([]IssueInfo, error) { @@ -68,6 +74,8 @@ func (c *Core) BreakingCheck(ctx context.Context, projectRoot, workingDir, path breakingChecker := &BreakingChecker{ against: againstProtoData, current: currentProtoData, + + filesCheck: c.breakingCheckConfig.FilesCheck, } return breakingChecker.Check() diff --git a/internal/core/breaking_checker.go b/internal/core/breaking_checker.go index 55d68f15..ed620ae7 100644 --- a/internal/core/breaking_checker.go +++ b/internal/core/breaking_checker.go @@ -12,6 +12,8 @@ const breakingCheckRuleName = "BREAKING_CHECK" type BreakingChecker struct { against ProtoData current ProtoData + + filesCheck bool } func (b *BreakingChecker) Check() ([]IssueInfo, error) {