New Flutter project with SonarQube configuration, lint, pre-commit and pre-push.
See: Sonar Flutter Plugin
Feature | Supported |
---|---|
Size | YES |
Issues | YES (dartanalyzer rules) |
Tests | YES |
Coverage | YES |
Complexity | YES |
Syntax | YES |
Install Docker as explained on the official documentaiton page.
Install Flutter as explained on the official documentaiton page.
Install Dart as explained on the official documentaiton page. If you have already installed flutter, it is not necessary to install Dart.
Install sonar-scanner as explained in the official documentation. It is recommended to place it in the system environment variables.
To start the sonarqube in the docker use the following command in root:
docker-compose up
Then check: http://localhost:9000/.
User: admin Password: admin It is recommended to change credentials after first login
Use the following commands from the root folder to start an analysis:
flutter pub get
flutter test
flutter test --machine --coverage > tests.output
sonar-scanner
or execute the sonar.sh in root of project in the root:
./sonar.sh
See: Flutter lints
The project was configured with githooks to format code in pre-commit and perform code analysis and testing in pre-push.
Run in the root:
git config core.hooksPath .githooks/
Run in powershell:
wsl -d docker-desktop
then
sysctl -w vm.max_map_count=262144