Migrations: Make generated code play well with StyleCop
See original GitHub issueSteps to reproduce
Add a new migration
The issue
Let me start with saying “Thanks for an awesome project”.
This isn’t a huge problem, but for all of us that uses StyleCop, adding a new migration creates a lot of warnings (and errors for release builds where warnings-as-errors are enabled).
- Namespaces in
Migrations/MyAppDbContextModelSnapshot
are not ordered alphabetically. - Namespaces in
Migrations/20161205224611_MyMigration.cs
are not ordered alphabetically. - Namespaces in
Migrations/20161205224611_MyMigration.Designer.cs
are not ordered alphabetically. - Access modifier for
Migrations/MyAppDbContextModelSnapshot
class is implicit. - Access modifier for
Migrations/20161205224611_MyMigration.Designer.cs
class is implicit.
I would be happy to provide a PR to fix this if you think it’s worth doing.
Another solution to this would be to add the standard <auto-generated>
header to the generated files.
Further technical details
EF Core version: (found in project.json or packages.config) Operating system: Windows 10 Visual Studio version: VS 2015
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Migrations: Make generated code play well with StyleCop ...
Steps to reproduce Add a new migration The issue Let me start with saying "Thanks for an awesome project". This isn't a huge...
Read more >How to Set Up StyleCop and Code Analysis on an Assembly
A well defined coding style paired with frequent peer reviews allow team members ... The first thing we need to do is install...
Read more >Stylecop vs FXcop
StyleCop performs source code analysis is not very configurable. It doesn't really do the same thing as FxCop, which analyzes the compiled code....
Read more >C# code style - "this." added to member usage even when ...
All my existing code is checked using StyleCop (which got broken with the 2018.1 GA release and was working fine during RC) so...
Read more >StyleCop Support for F# FAKE - Codit
StyleCop is a tool that analyzes your source files with the default Microsoft coding conventions describing how code should look like. It's not ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@patriksvensson we’d love to take a PR on this one. Here is what we think should be done…
<auto-generated>
to the.designer
files and to the model snapshotOdd, because it’s not being added to new migrations.