-
-
Notifications
You must be signed in to change notification settings - Fork 0
Development Guide
The following are the coding guidelines for development for Serval (and for the NLP team in general).
- For setting up your development environment, please look at the README.
All C# code should be formatted using CSharpier. The best way to enable support for CSharpier is to install the appropriate IDE extension and configure it to format on save.
Try to resolve all spelling issues by adding new entries into the settings.json if necessary.
- These abbreviations are valid: https://github.com/abbrcode/abbreviations-in-code
Here is a good overview of naming conventions. Here is a good overview of coding conventions. If you want to get in to even more detail, check out the Framework design guidelines and the ASP.NET Core Best Practices.
The .editorconfig
file specifies many of the naming conventions and formatting checks. All of the warnings should be resolved. Projects are set to fail if there are warnings on builds.
- Don't access other component's models directly, but use MassTransit consumer/producers and contracts to pass messages between, say, Serval.DataFiles and Serval.Translation.
- If a new field has to be added to a model file (that is stored in a MongoDB) ask yourself:
- If the field can legitimately be null in the future, make the field nullable
- If the field cannot legitimately be null in the future, migrate the database