-
Notifications
You must be signed in to change notification settings - Fork 85
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
Linter & Code Quality #216
Comments
These three:
From vague memory dymanoid used StyleCop in the Real Time mod to ensure consistent code comments, etc. This would be particularly useful for the planned TM:PE API (couldn't find issue tracking that) as we could use the proper code comments to auto-generate API docs to github.io, not to mention just making the source far more maintainable to anyone who hasn't been working on it the past 3+ years ;) There is also a non-open source, but free, U2U Consult Performance Code Analyzers which might be worth investigating. I don't know if it's usable with the version of .Net Framework that C:SL limits us to? All of the above work on VS2017 and would thus be suitable for open source contributions. I don't use the JetBrains IDE (Riser?) so can't comment on that. @krzychu124 might have some ideas in that respect. |
@VictorPhilipp We should ideally make a decision (well, really a decision between you and krzychu) on these things prior to any major code refactorings (such as move to harmony)? |
There is also SonarLint which, according to https://stackoverflow.com/questions/748631/lint-for-c-sharp also uses Roslyn under the hood. It can installed directly from VS marketplace: https://marketplace.visualstudio.com/items?itemName=SonarSource.SonarLintforVisualStudio2017 An important aspect is integratability (into build pipeline) and ease of use. I have just downloaded all four tools and try them for a while. |
@krzychu124 Maybe you could set up Travis CI for this repo? https://travis-ci.org/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition |
I checked SonarLint:
|
I checked Roslynator:
Maybe the problem is caused by the old csproj format we use (it's from VS 2015)? I tried to update it to the new format (https://natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/) but that did not make any difference. I found a GitHub issue (dotnet/roslynator#198) but setting the dropdown inside the error list to "Build + IntelliSense" did nothing. It's sad. Roslynator looks promising but I am unable to get it running. |
Regarding CodeMaid: This tool does not provide any static code analysis rules |
@krzychu124 was magically able to create a build pipeline which facilitates StyleCop. The VS project file was also fixed. Next steps:
|
Do not use that StyleCop version, it's obsolete. Use: They are implemented as Roslyn analyzers and can be easily integrated into any build environment, the severity of each particular issue can be configured (info/warning/error/ignore), etc etc See the Real Time repo for examples. |
Yeah, I know, that's why we are using StyleCop.Analyzers. Great extension. Thanks for links to other code analyzers 😉 |
Will we add any more of the analysers listed above or can this issue be closed? |
Some analysers were added to solution around v10.21 so closing this. Also, @kvakvs added brief style guide to wiki (also linked from contributing guide) here: https://github.com/CitiesSkylinesMods/TMPE/wiki/Code-style-and-naming |
stub
This is in reference to #211
I have some stuff in mind, will add it later.
The text was updated successfully, but these errors were encountered: