Skip to content

feat: adds support to inlined ignores#187

Merged
woodruffw merged 5 commits into
zizmorcore:mainfrom
tewokumu:ufs/patch-06
Nov 23, 2024
Merged

feat: adds support to inlined ignores#187
woodruffw merged 5 commits into
zizmorcore:mainfrom
tewokumu:ufs/patch-06

Conversation

@ubiratansoares

@ubiratansoares ubiratansoares commented Nov 22, 2024

Copy link
Copy Markdown
Contributor

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
Comment thread src/models.rs Outdated
@woodruffw

Copy link
Copy Markdown
Member

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.)

Comment thread src/finding/mod.rs Outdated
Comment thread src/finding/mod.rs
Comment thread src/finding/mod.rs Outdated
Comment thread src/main.rs Outdated
Comment thread src/finding/mod.rs
@woodruffw woodruffw added the enhancement New feature or request label Nov 23, 2024

@woodruffw woodruffw left a comment

Copy link
Copy Markdown
Member

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
Comment thread src/finding/mod.rs Outdated

@woodruffw woodruffw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @ubiratansoares!

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