Skip to content

fix: don't use quotes when generating ignore #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

teodora-sandu
Copy link
Contributor

@teodora-sandu teodora-sandu commented Jun 19, 2024

Description

Eclipse has functionality to generate ignores using the .snyk ignore file. At the moment, this works but the generated ignores is not being taken into account when running a scan. This is because of extra quotes that get added incorrectly to the ignore rule.

This PR removes the unnecessary quote when running the snyk ignore command.

When using the CLI this is how I generate ignores: snyk ignore --id=SNYK-JS-MARKED-2342073

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

Screenshots

I used https://github.com/snyk-labs/nodejs-goof to test.

There are 120 vulns without the ignore so I applied an ignore (I already had the one I tested earlier):
Screenshot 2024-06-19 at 12 03 50

After the ignore was generated we don't get the ignored vuln showing up (there are 111 vulns):
Screenshot 2024-06-19 at 12 06 52

Matches what the CLI returns too:
Screenshot 2024-06-19 at 12 07 25

note I did have to restart the sandbox because it wouldn't recognise $snyk.scan notifications anymore but I don't think it's because of this change:

@teodora-sandu teodora-sandu marked this pull request as ready for review June 19, 2024 11:07
@teodora-sandu teodora-sandu requested a review from a team as a code owner June 19, 2024 11:07
@bastiandoetsch
Copy link
Contributor

Snyk Scan have never been supported by Eclipse - they are just ignored (they'll cause a red log line when debugging though)

Copy link
Contributor

@bastiandoetsch bastiandoetsch left a comment

Choose a reason for hiding this comment

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

LGTM, I guess a test would be overkill here :D.

@teodora-sandu teodora-sandu merged commit a7fbd8c into main Jun 19, 2024
7 checks passed
@teodora-sandu teodora-sandu deleted the fix/quotes-snyk-ignore-file branch June 19, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants