cloudflare-docs/.semgrep/dates-in-docs.yaml
cd rubin 1e146bf316
Example custom semgrep rule for detecting fixed time references that is stored in repo for scanning against pull requests (#26647)
* Include custom semgrep rule stored in repo for scanning against pull requests

* disable metrics and root path to avoid warnings

* This rule must use the generic semgrep parser

* include a way to skip the local semgrep scan by including [skip semgrep] in commit message

* Require a fetch-depth of 0 to get all of the history

* Iin CI we compare committed changes made but when run locally we want to consider all changes made to the working directory (including uncommitted)

* Improved warning message for coming soon and included both committed and uncommitted changes in the local semgrep check

* Avoid fatal git error on ownership within CLI working directory
2025-11-24 15:40:08 +00:00

41 lines
1.2 KiB
YAML

rules:
- id: coming-soon
languages: [generic]
message: "Found forbidden string 'coming soon'. Too often we set expectations unfairly by attaching this phrase to a feature that may not actually arrive soon."
severity: MEDIUM
paths:
include:
- "*.htm"
- "*.html"
- "*.md"
- "*.mdx"
- "*.yaml"
- "*.yml"
exclude:
- "/src/content/changelog/**"
- "/src/content/release-notes/**"
- "/.semgrep/**"
- "/.github/**"
patterns:
- pattern-regex: "[Cc]oming [Ss]oon"
- id: potential-date
languages: [generic]
message: "Potential date found. Documentation should strive to represent universal truth, not something time-bound."
severity: MEDIUM
paths:
include:
- "*.htm"
- "*.html"
- "*.md"
- "*.mdx"
- "*.yaml"
- "*.yml"
exclude:
- "/src/content/changelog/**"
- "/src/content/release-notes/**"
- "/.semgrep/**"
- "/.github/**"
pattern-either:
- pattern-regex: Jan\| Feb\| Mar\| Apr\| May\| Jun\| Jul\| Aug\| Sep\| Nov\| Dec
- pattern-regex: \ 20[0-9][0-9]