Rename KICSCommentRgxp identifiers to DDCommentRgxp and clean up kics comments#177
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 5404f42 | Docs | Datadog PR Page | Give us feedback! |
ee31ffa to
8e56626
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e56626db2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // KICSCommentRgxpYaml is the regexp to identify if the comment has KICS comment at the end of the comment in YAML | ||
| KICSCommentRgxpYaml = regexp.MustCompile(`((/{2})|#)*\s*dd-iac-scan\s*(ignore-line|ignore-block)\s*\n*$`) | ||
| // DDCommentRgxp identifies dd-iac-scan inline suppression comments | ||
| DDCommentRgxp = regexp.MustCompile(`(^|\n)((/{2})|#|;)*\s*dd-iac-scan\s*`) |
There was a problem hiding this comment.
Preserve existing exported comment regex names
In downstream Go code that imports github.com/DataDog/datadog-iac-scanner/pkg/model, this rename removes the previously exported model.KICSCommentRgxp, model.KICSGetContentCommentRgxp, and model.KICSCommentRgxpYaml identifiers, so consumers upgrading this module will fail to compile even though the change is described as having no exported API impact. Please keep deprecated aliases to the new DD* variables (or otherwise make the breaking change explicit) so existing integrations continue to build.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
These regexes are only used across internal pkg/* packages; there are no known external Go importers of this module for these symbols. Adding KICS* aliases would undo the naming cleanup. We’re treating this as an intentional rename of previously exported-but-internal helpers; anyone embedding the module can switch to DDCommentRgxp / DDGetContentCommentRgxp / DDCommentRgxpYaml.
8e56626 to
46e9e30
Compare
ChouraquiBen
left a comment
There was a problem hiding this comment.
No issues on the code but the name of the PR claims that the kics comment are removed. I some in other places, for example pre_scan.go so I am not sure what this entails
46e9e30 to
7472a04
Compare
@ChouraquiBen because I missed some... |
Motivation
Final cleanup of KICS/Checkmarx naming in internal Go identifiers and code comments. No behavior change.
Changes
model package
KICSCommentRgxp,KICSGetContentCommentRgxp,KICSCommentRgxpYamlrenamed toDDCommentRgxp,DDGetContentCommentRgxp,DDCommentRgxpYamlrespectively. All 6 call sites updated.Comments
Remaining
// kics ...and// KICS ...doc strings incomment.go,functions/default.go,provider/extract.go, andtest/helpers.goreworded to remove the KICS reference.QA Instruction
go build ./...go test ./pkg/model/... ./pkg/parser/terraform/comment/... ./pkg/parser/docker/... ./pkg/parser/buildah/...Impact
Internal rename only. No exported API, no CLI flags, no rule format affected.