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

feat: adds support to inlined ignores #187

Merged
merged 5 commits into from
Nov 23, 2024

Conversation

ubiratansoares
Copy link
Contributor

@ubiratansoares ubiratansoares commented Nov 22, 2024

Closes #124

There are 2 approaches here

  • 8f1a18c propose a change at FindingRegistry level
  • 14d2dd0 proposes a change at FindingBuilder level

In both of them the core remains the same :

  • we cache the YAML string contents at Workflow
  • we use Finding.location to extract the start and end rows related to the impacted snippet
  • we loop through the lines, checking whether or not we have a comment disabling that particular check

Happy to iterate on this idea. If one of them makes sense, happy to add a commit with proper docs

How to test

  • Pull this branch
  • Run
cargo run -- tests/test-data/inlined-ignores.yml
➜  zizmor git:(ufs/patch-06) cargo run -- tests/test-data/inlined-ignores.yml
   Compiling zizmor v0.4.0 (/Users/lonewolf/RustroverProjects/zizmor)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.20s
     Running `target/debug/zizmor tests/test-data/inlined-ignores.yml`
🌈 completed inlined-ignores.yml
No findings to report. Good job! (3 ignored)

@ubiratansoares ubiratansoares changed the title Ufs/patch 06 feat: adds support to inlined ignores Nov 22, 2024
@woodruffw
Copy link
Owner

Thanks @ubiratansoares! I like the FindingBuilder approach, let's move forwards with that 🙂

(Apologies for the merge, that was a force of habit. If it makes things annoying here, please feel free to force-push over it.)

@woodruffw woodruffw added the enhancement New feature or request label Nov 23, 2024
Copy link
Owner

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

Thanks @ubiratansoares!

I think I'd like to see #187 (comment) in this PR, but otherwise everything looks fantastic to me (and we can start follow-up issues/PRs for the other things).

@ubiratansoares ubiratansoares marked this pull request as ready for review November 23, 2024 22:18
Copy link
Owner

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

Thanks @ubiratansoares!

@woodruffw woodruffw merged commit bf2fe8c into woodruffw:main Nov 23, 2024
4 checks passed
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.

Support ignoring results via inline comments?
2 participants