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

Analyzers that verify this is used in all public methods #165

Open
C0DK opened this issue Dec 21, 2021 · 3 comments
Open

Analyzers that verify this is used in all public methods #165

C0DK opened this issue Dec 21, 2021 · 3 comments

Comments

@C0DK
Copy link

C0DK commented Dec 21, 2021

Awesome package. Love it.

We currently employ units tests to verify that guard clauses are used in all public methods, which is done by extending the AutoFixture idiom helper and then searching all packages in the solution.

Testing code quality via unit tests isn't ideal, and it would be nice not to have it as part of our test suite but instead utilize Roslyn, which I assume might be possible. (I might be wrong, though!)

Not sure if this would be too much of a stretch compared to this otherwise light package, but one might name a separate sub-project.

I'll try to work on it myself if I have time one day, but I am currently somewhat busy.

@C0DK
Copy link
Author

C0DK commented Dec 21, 2021

I'm seeing some stuff here. https://github.com/dotnet/roslyn-analyzers/blob/main/docs/Analyzer%20Configuration.md#null-check-validation-methods

Could we maybe just extend the readme to help users doing this?

@ardalis
Copy link
Owner

ardalis commented Jan 18, 2022

@C0DK The Roslyn approach to just specify that Ardalis.GuardClauses method perform null checks looks good. Have you gotten it to work and if so what, specifically, did you specify to inform Roslyn?

@ardalis
Copy link
Owner

ardalis commented May 17, 2022

If you want to provide a PR to extend our README that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants