Improve code quality with automated tools

a Sufficiently large number of people use github to store the source code of their projects. Ideology fork/pull request allows you to easily perform code review (code review). Code review greatly increases the encoding quality in the project. However, often the person performing the code review has to do with checking the coding standards adopted in the project, and other obvious things not directly related to the task solved in the pull request. Such coding errors can and should be detected automatically.

lint(likely to be bugs) in a program designed to find suspicious and nonportable parts of your code. Modern lint programs often explore including for compliance with the coding standard. Of course every developer is obliged to install on your computer removal tool to scan code and create pull requests if the code is clean. However, integration problems, misconfiguration, not a care or simple negligence lead to the fact that coding standards are violated. In the network there are a sufficient number of utilities performing the verification code, all of them heterogeneous in terms of settings and output formats. In multi-language company that leads to the fact that setting up the workplace becomes not a trivial task.

I offer a service to automatically check for known code lint-utilities. Currently supported are:
the

There are several ways to use this service. You can just try and test any pull request, you just need to paste the link into the appropriate field and click Advice.



After a long hesitation, you will get a generated report with all files from the pull request.



The owners of private repositories can also check your pull requests. For this you need create token access and enter it in the additional form field. If you are concerned about a healthy form of paranoia, it is still possible to deploy the service locally, who is interested please write in PM.

Another option is the use of the service, use the browser plug-ins Chome or Firefox. After you install the browser button will appear, clicking on which will check the open on the current page pull request.

But, the best way to use, configure a Post-Receive Hook for your repository. In this case, after each update of the pull request, it will be checked, and the page request will be a short description about the quality of the code.

For example, good code:


And this is not very


To configure the service to work with your repository you need to create a WebHook URL unlint.org/github/hook:token. The parameter :token is only needed for private repositories, which would provide access to inspectors of the service. Who is not familiar with the github api can use form to generate curl request to create a WebHook URL.

IMPORTANT. you Cannot use the form in the settings of your repository to create a WebHook URL, because it creates an observer for your commits, but not pull requests, you need to use github api to create a WebHook URL watching pull requests.
The application of this service allows to facilitate the work of inspectors, and to standardize the code in the company.

unlint.github.com
The project page github

Why service is so slow
at the same time, the system checks no more than 3 files, this is due to low server performance. You can deploy unlint locally that would solve these problems.

I found a bug/Need to add a check
Need to write me, either on github.

I need other standards
You can deploy unlint locally and configure any verification.

is it Safe to use a token to access the private repository?
No, it's not secure, because data is transmitted over an unencrypted channel.

deploy locally
All source code available in the repository of the project so the service can be installed locally. Detailed documentation yet, a personal contact will help.
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Briefly on how to make your Qt geoservice plugin

Database replication PostgreSQL-based SymmetricDS

Yandex.Widget + adjustIFrameHeight + MooTools