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

Avoid panic when searching for .regal/config.yaml #684

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

anderseknert
Copy link
Member

As reported in #682, the server panics when the dir for whatever reason is "". I don't yet know how to trigger this, and the result of this fix is likely that the config file won't be found when this happens. But as a temporary measure I prefer to have Regal run with default configuration compared to crashing.

As reported in #682, the server panics when the dir for whatever reason
is "". I don't yet know how to trigger this, and the result of this fix
is likely that the config file won't be found when this happens. But as
a temporary measure I prefer to have Regal run with default configuration
compared to crashing.

Signed-off-by: Anders Eknert <anders@styra.com>
@@ -299,7 +299,7 @@ func lint(args []string, params *lintCommandParams) (report.Report, error) {
}

regal = regal.WithUserConfig(userConfig)
case err != nil && params.configFile != "":
case params.configFile != "":
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated. Just fixing a redundant check as the condition will always be true.

@anderseknert anderseknert merged commit 0c3043d into main Apr 25, 2024
3 checks passed
@anderseknert anderseknert deleted the avoid-panic-in-find-config branch April 25, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants