Hi Backend Engineers,
To provide better code readability, we are implementing code style checker and linter on our codebase. By doing this, we hope that every code will use the same code style/format eventually. Therefore our code is easier to understand and when we have to do code review, we can focus on the actual changes rather than verify the code format.
We use Checkstyle as our code style checker. It supports integration with IntelliJ IDEA as a plugin. Therefore as we code, it checks automatically on the IDEA and highlights non-compliant code style. To make it easier to reformat your code, you may use reformat feature on IDEA by using Ctrl + Shift + Alt + L
.
At last, we use Arcanist Lint as our linter which integrates Checkstyle with Phabricator. It will run Checkstyle on source codes that get changed based on the branch where it come from. After that, it checks only on the actually code line changes, instead of the entire file. Therefore you don't have to reformat the whole code, although it will be better.
To implement Checkstyle and Arc Lint on your environment and what will changes on your IDEA, please refer to Backend Code Style wiki. We are planning to integrate the linter at old-monorepo-2017
repository on Monday, 30 October 2017 at 17.00
(relanded). Kindly visit Backend Code Style wiki.
As summary, the impact will be:
Ctrl + Shift + Alt + L
], then do manual reformat if neccesary.
old-monorepo-2017
repo, when you do arc diff/land, it will run arc lint which run Checkstyle and notify if there is any non-compliant code style on your changes.
If there are any questions, kindly leave a comment on this post. Thanks!
ISSUE & RESOLUTION :
arc diff --create
failed caused by PhutilMissingSymbolException: Failed to load class or interface 'DOMDocument'
.
sudo apt install php7.0-xml
intellij-settings-1.1.0.jar
.
intellij-settings-1.1.0.jar