Skip to content

Latest commit

 

History

History
87 lines (48 loc) · 3.09 KB

CONTRIBUTING.md

File metadata and controls

87 lines (48 loc) · 3.09 KB

Contributing to django-stomp-debug-callback

Lint

The use of .pre-commit-config.yaml flake8, black, isort and pylint is required to the app development.

You should always reformat your code before committing to the project.

Test

Make sure to run all the tests before opening a pull request. Any new feature should also be tested!

Sonar

We use sonar as a static code analyzer to look for improvements.

To test sonar local you can use the steps bellow.

1 - Run sonar server

To running the sonar server, just use the command:

docker-compose up sonar

And wait a few minutes for ElasticSearch, database, and other tools used by Sonar behind the scenes to be configured.

After uploading the server, we can access SonarQube at http://localhost:9000.

2 - Creating the project setup on the local Sonar Server

By default, the server uses the credentials below to login: username: admin password: admin

step 1 sonar

When logging in for the first time, you will need to update your password. In order for us to be able to use the sonar-cli service added to docker-compose.yaml correctly, we must update the password to the value of the SONAR_PASSWORD variable, which in this case is set to test

step 2 sonar

3 - Configure juntossomosmais_django-stomp-debug-callback project into sonar server.

After changes password we can see the initial screen below.

Let's click on the Add Project button step 4 sonar

choose option manually step 4 sonar

Insert the project key from sonar-project.properties in this project we can use juntossomosmais_django-stomp-debug-callback step 5 sonar

After the steps above we can see project configured in sonar server step 6 sonar

4 - Run sonar-cli and see sonar analysis.

To run the sonar-cli first we need to export the test and coverage metrics to be analyzed.

For this we can use the test service of docker compose or manually run the test command:

  • docker: docker-compose up tests
  • manually execution: pipenv tox

After tests execution we can run sonar-cli using docker-compose using command

docker-compose up sonar-cli

step 7 sonar

We can see all analysis and fix the appointments before submitting the PR.

Commits

The commit summary should be structured as conventional commits standard.

Reviewing pull requests

The pull request review contributions should follow conventional comments standard.

Pull assignees and labels

When creating a new pull request you must set at least one assignee and one label.