Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Add a new constraints syntax #92

Merged
merged 2 commits into from
Oct 1, 2021
Merged

Conversation

lmt-swallow
Copy link
Member

@lmt-swallow lmt-swallow commented Oct 1, 2021

Description

This PR changes the format of patterns. In detail, now patterns takes a pattern and constraints as an element. Here's an example:

version: "1"
rules:
  - id: test
    title: test
    tags:
      - low
    language: hcl
    message: "test"
    patterns:
      - pattern: |
          a = :[ATTR]
        constraints:
          - target: ATTR
            should: not-match-regex
            pattern: "^enabled$"

Checklist

  • I opened a draft PR or added the [WIP] to the title if my PR is not ready for review.
  • I have reviewed the code by myself.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have added tests enough to show how your code behaves and that your code works as expected.

Additional Notes

N/A

Signed-off-by: Takashi Yoneuchi <takashi.yoneuchi@shift-js.info>
Signed-off-by: Takashi Yoneuchi <takashi.yoneuchi@shift-js.info>
@netlify
Copy link

netlify bot commented Oct 1, 2021

❌ Deploy Preview for cranky-fermi-e6c846 failed.

🔨 Explore the source changes: c64cbef

🔍 Inspect the deploy log: https://app.netlify.com/sites/cranky-fermi-e6c846/deploys/61570e439b82e800070feea5

@lmt-swallow lmt-swallow merged commit 8128340 into main Oct 1, 2021
@lmt-swallow lmt-swallow deleted the feature/new-constraints-syntax branch October 1, 2021 13:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant