Skip to content
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

fix(detectors): handle dirs that are not dirs for dotnet #88

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

elsapet
Copy link
Contributor

@elsapet elsapet commented Oct 27, 2022

Description

We were getting errors from dotnet when scanning a file and not a directory e.g.

{
  "file": "",
  "message": "accept dir failed for detector dotnet: fdopendir /Users/elsapet/Bearer/api-management-app/db/seed/policy_engine/policy_templates.json: not a directory",
  "type": "error"
}

To fix, we add a check for whether a given path leads to a directory or a single file, and handle as appropriate.

Checklist

  • I've added test coverage that shows my fix or feature works as expected.
  • I've updated or added documentation if required.
  • I've included usage information in the description if CLI behavior was updated or added.
  • PR title follows Conventional Commits format

@swarmia
Copy link

swarmia bot commented Oct 27, 2022

@elsapet
Copy link
Contributor Author

elsapet commented Oct 27, 2022

@vjerci Any guidance on how to add a test for this case?

@elsapet elsapet force-pushed the AMA-3065-dotnet-detector-errors-when-it-shouldnt branch 3 times, most recently from baeebdc to 20a92ab Compare October 27, 2022 16:22
spdawson
spdawson previously approved these changes Nov 1, 2022
Copy link
Contributor

@spdawson spdawson left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me; though of course you may want to wait for a review from someone more familiar with Go 🙂

vjerci
vjerci previously approved these changes Nov 2, 2022
@elsapet elsapet force-pushed the AMA-3065-dotnet-detector-errors-when-it-shouldnt branch from 20a92ab to a1c6bcf Compare November 2, 2022 09:58
@elsapet elsapet dismissed stale reviews from vjerci and spdawson via cad02ca November 2, 2022 10:28
@elsapet elsapet force-pushed the AMA-3065-dotnet-detector-errors-when-it-shouldnt branch from a1c6bcf to cad02ca Compare November 2, 2022 10:28
@elsapet elsapet merged commit b483eb7 into main Nov 2, 2022
@elsapet elsapet deleted the AMA-3065-dotnet-detector-errors-when-it-shouldnt branch November 2, 2022 13:18
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.

None yet

3 participants