Comments (3)
So this is determined by dotnet code quality analyzier FxCop.
On can configure these in .editorconfig file.
https://github.com/dotnet/roslyn-analyzers/blob/master/docs/Analyzer%20Configuration.md#null-check-validation-methods
dotnet_code_quality.null_check_validation_methods = NotNull
But adding NotNull there does still not get it to go away. :(
from guard.
Hi Steven, sorry for the late response.
The actual method you pass aNext
is Argument
, you then pass the initialized ArgumentInfo<T>
object to NotNull
. So using "Argument" instead of "NotNull" may work. It would, however, consider every guard as a null guard, making the analysis somewhat less useful.
I'm not sure how I can statically prove to FxCop that the argument can't be null if the NotNull method returns (instead of throwing) on my end. Using Code Contracts may have worked but it's dead for some time now. I for one really wish it had taken off, I probably wouldn't develop Guard at the first place :/
I believe using C# 8's nullable reference types are the official way to go now. I understand it may not be feasible for you to just move your whole project to C# 8, so the best compromise I can think of is to use dotnet_code_quality.null_check_validation_methods = Argument
if it works.
I'm open to suggestions and as always, thank you for using Guard.
from guard.
Closing this issue as it has been inactive for 46 days. Feel free to re-open if needed.
from guard.
Related Issues (20)
- Interop NotNullWhenAttribute leaks HOT 1
- Support for both directory and file path validation HOT 2
- How to return the Exception instead of throwing it HOT 3
- Problem with "InitContainsDuplicate" on .NET < 4.7.2 HOT 1
- Multiple checks with same custom message HOT 3
- How to Guard an ICollection member HOT 1
- CA1062 warning HOT 5
- Support validation/guard-clauses for collection items HOT 1
- Guard variants for nullable types HOT 2
- how to validata the string is a valid email address? HOT 1
- NotDefault limited to struct HOT 1
- Unacceptable performance HOT 3
- Add support for 'CallerArgumentExpression' attribute HOT 9
- Confirm parameter is one of list of Types HOT 1
- Binary Backward Compatibility HOT 2
- Document inclusivity of InRange HOT 2
- Similar fluent-style guard library for javascript
- Enhanced String char based guards. HOT 2
- 'NotNull' validation should be available for unconstrained generic types HOT 2
- Status on v2 of the library HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from guard.