demo: suppression showcase (inline + global) with verification#6
Open
demo: suppression showcase (inline + global) with verification#6
Conversation
| // valk-guard:disable VG001 | ||
| _, _ = db.QueryContext(ctx, "SELECT * FROM users LIMIT 1") | ||
|
|
||
| _, _ = db.QueryContext(ctx, "SELECT * FROM users LIMIT 1") |
There was a problem hiding this comment.
VG001: avoid SELECT *; project only required columns | Query: SELECT * FROM users LIMIT 1
| # valk-guard:disable VG001 | ||
| session.execute(text("SELECT * FROM users LIMIT 1")).all() | ||
|
|
||
| session.execute(text("SELECT * FROM users LIMIT 1")).all() |
There was a problem hiding this comment.
VG001: avoid SELECT *; project only required columns | Query: SELECT * FROM users LIMIT 1
| -- valk-guard:disable VG001 | ||
| SELECT * FROM users LIMIT 1; | ||
|
|
||
| SELECT * FROM users LIMIT 1; |
There was a problem hiding this comment.
VG001: avoid SELECT *; project only required columns | Query: SELECT * FROM users LIMIT 1
aac5d82 to
8bdbc19
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Show all practical suppression levels with working examples:
What Is Included
demo/suppressions/inline/sql_inline.sqldemo/suppressions/inline/go_inline.godemo/suppressions/inline/python_inline.pydemo/suppressions/config/global_disable_vg001.yamldemo/suppressions/README.mdHow It Works
1) Specific query suppression
Use a directive on the line before the statement:
-- valk-guard:disable VG001// valk-guard:disable VG001# valk-guard:disable VG001This suppresses only that rule for the next statement.
2) Statement-wide suppression
Use a bare directive:
-- valk-guard:disable// valk-guard:disable# valk-guard:disableThis suppresses all rules for the next statement.
3) Global suppression
Disable a rule in config:
Verification (Run Locally)
Verified result on this branch:
3findings (VG001only; unsuppressed statements)0findingsAdditional CI Reliability Fixes Included
This PR also carries the already-proven workflow compatibility fix for
Convert to reviewdog formatand pinsVALK_GUARD_INSTALL_REFto a known working build so the suppression demo is not blocked by unrelated JSON-shape drift.