-
Notifications
You must be signed in to change notification settings - Fork 3
Coding style
We used some keywords in comments to identify certain code sections. They all start with odr.
All modified Refine code is enclosed in these comments:
// odr start
// odr end
New classes added in Refine namespace are marked with
/**
odr new
*/
Comments that were already in Refine and have been changed or added are marked with
/**
odr comment
*/
todo find & replace odr javadoc with odr comment
To mark nullable variables we used the @Nullable tag from from JSR-305. Latest IDEs can recognize the tag and warn about unchecked null usage. Wherever possible we also marked Refine nullable fields. We consider all the objects as non null unless marked otherwise. todo how to configure default value?
Example usage:
@Nullable String s;
Not-so-clean code is marked with
// odr dirty
For code quality management we are using SonarQube with Javascript plugin. Inside the code we adopted tags from JSR 305 in the implementation of findbugs. When deploying, we use Animal sniffer maven plugin to ensure only JDK api <= 1.7 are used in the project.
For displaying dates/numbers/currency we use Globalize.js. Don't use functions that change capitalization to display text. Let translators deal with it. When using capitalization to normalize text for searching, remember to include the locale, i.e. mystring.toLowerCase(Locale.ITALIAN)
Each patch to refine lives in its own branch. OpenDataRise has a 'view' of Refine consisting of all patches to Refine in odr-buffer branch