-
Notifications
You must be signed in to change notification settings - Fork 84
Roslyn Analyzers and Compile-Time Binding Registry #541
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
base: main
Are you sure you want to change the base?
Conversation
Great stuff! I haven't checked the code, but only read the pull request description One small note:
AFAIK ValueTask is also supported. And is a separate repo not a better idea for the analyzers? |
I based this off the constraints in our documentation. If
I have no strong feelings on repo structure. I'd expected both analyzer and generator pieces to be shipped with the core libraries in the same way xunit does, which makes me prefer a single repository. I'm generally in favour of monolithic repos though, which can absolutely colour my judgement. |
See https://docs.reqnroll.net/latest/guides/migrating-from-specflow.html
And about:
In my experience mono repos move slower (more time to merge prs, more time when released), but it's just a suggestion :) |
Unfortunately, that's not reflected in the documentation regarding step definitions:
|
🤔 What's changed?
This branch contains multiple Roslyn-centric extensions for Reqnroll. The implementation is basic and only covers the C# language, but could be extended to do more.
Added suite of analysers to identify common problems with step bindings:
StepMethodMustReturnVoidOrTaskAnalyzer
: ensures a step method must returnTask
orvoid
- all other return types flag an error.AsyncStepMethodMustReturnTaskAnalyzer
: ensures a step method marked with theasync
keyword must also return aTask
- all other return types are invalid.StepTextAnalyzer
: looks at the step text applied in a step attribute:Added a generator which produces a step registry for an assembly being built: a class which contains a set of metadata of all the methods decorated with step definition attributes:
Added types to the Reqnroll core library to support expressing a step definition registry as a collection of metadata.
⚡️ What's your motivation?
This work is based on the discussion https://github.com/orgs/reqnroll/discussions/208
Knowing about problems at runtime is fine, but discovering them during authoring is better!
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
📋 Checklist:
This text was originally taken from the template of the Cucumber project, then edited by hand. You can modify the template here.