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

linter: mask filtering rules path #1244

Merged
merged 4 commits into from
Feb 2, 2025
Merged

Conversation

Hidanio
Copy link
Contributor

@Hidanio Hidanio commented Jan 31, 2025

No description provided.

@Hidanio Hidanio self-assigned this Jan 31, 2025
@Hidanio Hidanio marked this pull request as ready for review January 31, 2025 14:24
@Hidanio Hidanio added the enhancement New feature or request label Jan 31, 2025
@Hidanio Hidanio force-pushed the hidanio/mask_filtering_rules_path branch from 6b849aa to 4fe6e2c Compare February 2, 2025 16:16
@Hidanio Hidanio merged commit 9ca19fc into master Feb 2, 2025
4 checks passed
@Hidanio Hidanio deleted the hidanio/mask_filtering_rules_path branch February 2, 2025 16:30

for {
i++
if i >= len(parts) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you don't change the parts, why calculate its length every time?

@@ -1526,21 +1526,79 @@ func IsRuleEnabledForPath(root *RuleNode, filePath string, checkRule string) boo
// Starting with global state. We have guarantee while parsing config that rule is `on` and exist
ruleState := true

for _, part := range parts {
Copy link
Contributor

Choose a reason for hiding this comment

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

in go for-range returns the index and the value of the elements in each index. Are you sure you should have changed it to for-loop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants