Skip to content

Commit

Permalink
Add --offline flag to pint ci command
Browse files Browse the repository at this point in the history
  • Loading branch information
prymitive committed Nov 29, 2021
1 parent 1f18fcb commit bd92320
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [next]

### Added

- `--offline` flag for `pint ci` command.

## v0.3.0

### Added
Expand Down
1 change: 1 addition & 0 deletions cmd/pint/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func actionCI(c *cli.Context) (err error) {
if err != nil {
return fmt.Errorf("failed to load config file %q: %w", c.Path(configFlag), err)
}
cfg.SetDisabledChecks(c.Bool(offlineFlag), nil)

includeRe := []*regexp.Regexp{}
for _, pattern := range cfg.CI.Include {
Expand Down
1 change: 0 additions & 1 deletion cmd/pint/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func actionLint(c *cli.Context) (err error) {
if err != nil {
return fmt.Errorf("failed to load config file %q: %w", c.Path(configFlag), err)
}

cfg.SetDisabledChecks(c.Bool(offlineFlag), c.StringSlice(disabledFlag))

d := discovery.NewGlobFileFinder()
Expand Down
8 changes: 8 additions & 0 deletions cmd/pint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ func newApp() *cli.App {
Name: "ci",
Usage: "Lint CI changes",
Action: actionCI,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: offlineFlag,
Aliases: []string{"o"},
Value: false,
Usage: "Disable all check that send live queries to Prometheus servers",
},
},
},
{
Name: "config",
Expand Down

0 comments on commit bd92320

Please sign in to comment.