Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regal fix ignores config level: ignore #1342

Closed
grosser opened this issue Jan 16, 2025 · 5 comments · Fixed by #1357
Closed

regal fix ignores config level: ignore #1342

grosser opened this issue Jan 16, 2025 · 5 comments · Fixed by #1357
Assignees
Labels
bug Something isn't working

Comments

@grosser
Copy link

grosser commented Jan 16, 2025

regal fix --force foo.rego
1 fix applied:
foo.rego:
- opa-fmt

but my .regal/config.yaml has

  style:
    opa-fmt:
      level: ignore

... so it should not touch that, the docs say "ignore — disable the rule entirely"

@anderseknert
Copy link
Member

Hey @grosser, and thanks for letting us know. We've done a bunch of work recently on getting formatting to play nicely with both Rego v0, v1 and even mix of the two.. so it's likely an oversight somewhere in those changes. We'll look into it.

@anderseknert anderseknert added the bug Something isn't working label Jan 21, 2025
@charlieegan3
Copy link
Member

Hey @grosser, thanks for raising the issue. I cannot seem to replicate this:

…/regal/temp main ➜ ./regal_Darwin_arm64 version
Version:    0.30.2
Go Version: go1.23.3
Platform:   darwin/arm64
Commit:     2c6ee8e23a1d1625780c4a057d60d954ca9fea7f
Timestamp:  2025-01-16T17:33:07Z
Hostname:   github.actions.local

…/regal/temp main ➜ cat foo.rego
   1   │ package wow
   2   │
   3   │ allow :=  true

…/regal/temp main ➜ cat .regal/config.yaml
   1   │ rules:
   2   │   style:
   3   │     opa-fmt:
   4   │       level: ignore

…/regal/temp main ➜ ./regal_Darwin_arm64 fix --force foo.rego
1 fix applied:
In project root: /Users/charlieegan3/Code/regal/temp
foo.rego -> wow/foo.rego:
- directory-package-mismatch

Can you share your Regal version?

@grosser
Copy link
Author

grosser commented Jan 22, 2025

Version: 0.30.2

mv .regal/config.yaml .regal.yaml
regal fix --force wow/foo.rego
1 fix applied:
In project root: foo
wow/foo.rego:
- opa-fmt

... so it's an issue with the regal config location

@charlieegan3
Copy link
Member

Ahh, that's interesting and unfortunate. Let me see if I can work out what's going on here.

@charlieegan3
Copy link
Member

I think this should be all the fixes we need here: #1357, thanks for the continued testing here.

Feel free to download a binary from https://github.com/StyraInc/regal/pull/1357/checks if you want to try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants