Dear team, Since SINGA is going to graduate soon from the incubator, I propose to use some tools to ensure high code quality. These tools check for known problems in the code and provide a detailed report for fixing them. May be some code came from scientific experimental projects. We need to improve this code according to industry standards, so it can be used with more real life projects.
1. I propose to add the code quality tools (cpplint[1], pylint[2] and lgtm[3]) to SINGA contribution guideline[4], so that each developer is encouraged to install and run code quality checks in his local repo and fix any problems before creating a pull request. 1.A CPP Lint: running cpplint in the src directory shows 822 errors, while running in the include directory shows 708 errors. The guidelines [4] has an outdated information that instructs developers to use an old non-existing file tool/cpplint.py. 1.B Python Lint: running pylint in python/singa shows 5.00/10 rating, while running in python/rafiki shows 0.00/10 rating. 1.C LGTM :There is a Jira ticket for adding LGTM badges to the README[5], so the quality of the code becomes more clear to everyone. LGTM pull request automation can't be enabled in Apache repo due to infra restrictions[6], but it works on personal forks of the project. Currently LGTM rates both C++ and Python code in SINGA as grade D. 2. I propose also to give the code quality higher priority in the next release since it is probably going to be the first release after graduation. The team is invited to fix as much as possible from the current code issues and to use tools that check their new code before pushing it to SINGA. Let's try to make the lgtm grade and lint rating as high as possible. Improving code quality is required to attract new users and developers. Users will trust more the project with better code and developers will be happy to contribute to it. It will also make the code review process easier and more productive instead of wasting time in finding and fixing known code problems. New developers (or old developers who did not contribute for a while and would like to warm up) can start working on fixing lgtm and lint issues, since they are usually easy and there is a clear explanation of the problem and how to solve it. What do you think? p.s. This discussion is the first topic in a series of proposals to improve SINGA as it will be an Apache top level project soon. The next proposal will discuss improving the build and test pipeline in a separate thread to avoid discussing too many things in one thread. best regards, Moaz [1] https://pypi.org/project/cpplint/ [2] https://www.pylint.org/ [3] https://lgtm.com/ [4] http://singa.apache.org/develop/contribute-code.html [5] https://issues.apache.org/jira/projects/SINGA/issues/SINGA-484 [6] https://issues.apache.org/jira/browse/INFRA-17954