Skip to content

Commit add6e6f

Browse files
authored
Merge pull request #164 from insideapp-oss/feat/improvments
Improvements & clean up
2 parents 7f3cb73 + c3432f2 commit add6e6f

File tree

98 files changed

+6044
-10467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+6044
-10467
lines changed

.github/workflows/release-drafter.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,54 @@
1-
name: Publish release
1+
name: Release
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
tags:
6+
- 0.*
67

78
jobs:
89
build:
9-
name: Build and upload release
10+
1011
runs-on: ubuntu-latest
12+
1113
steps:
12-
- uses: actions/[email protected]
14+
- name: Checkout
15+
uses: actions/[email protected]
16+
17+
- name: Retrieve tag name
18+
uses: olegtarasov/[email protected]
19+
id: tag_name
20+
1321
- name: Set up JDK 1.11
1422
uses: actions/[email protected]
1523
with:
1624
distribution: 'adopt'
1725
java-version: '11'
1826
check-latest: true
1927
cache: 'maven'
20-
- name: Build with Maven
28+
29+
- name: Set version
30+
run: mvn versions:set -DnewVersion=$GIT_TAG_NAME
31+
32+
- name: Build
2133
run: mvn -B package --file pom.xml
22-
- name: Upload release artifact
23-
uses: shogo82148/[email protected]
34+
35+
- name: Analyze
36+
env:
37+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
run: |
40+
mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
41+
-Dsonar.login=$SONAR_TOKEN \
42+
-Dsonar.host.url=https://sonarcloud.io \
43+
-Dsonar.organization=insideapp-oss \
44+
-Dsonar.projectKey=insideapp-oss_sonar-flutter
45+
46+
- name: Upload release
47+
uses: svenstaro/upload-release-action@v2
2448
with:
25-
upload_url: ${{ github.event.release.upload_url }}
26-
asset_path: sonar-flutter-plugin/target/sonar-flutter-plugin-*.jar
49+
repo_token: ${{ secrets.GITHUB_TOKEN }}
50+
file: ${{github.workspace}}/sonar-flutter-plugin/target/*.jar
51+
tag: ${{ steps.tag_name.outputs.tag }}
52+
overwrite: true
53+
body: ${{steps.build_changelog.outputs.changelog}}
54+
file_glob: true

.mvn/wrapper/MavenWrapperDownloader.java

Lines changed: 0 additions & 117 deletions
This file was deleted.

.mvn/wrapper/maven-wrapper.jar

-49.5 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,52 @@
11
## Please check the Github releases for newer changelogs!
22

3-
---
3+
## develop
4+
5+
#### Breaking
6+
7+
- SonarQube API update to 7.9 for latest LTS support (9.9)
8+
- Removed `dartanalyzer` implementation that scans each file individual, this may affect projects running on a (pretty) old Dart SDK.
9+
The replacement runs legacy `dartanalyzer .` instead which is much faster.
10+
- Renamed `sonar.flutter.analyzer.mode` to `sonar.dart.analyzer.mode` and reworked implementation.
11+
- Available options `DETECT|DART|FLUTTER|MANUAL|DARTANALYZER`
12+
- Defaults to automatic detection by parsing the `pubspec.yaml`.
13+
- Uses `flutter analyze` when `environment.flutter` is configured in `pubspec.yaml`.
14+
- Uses `dart analyze` when `environment.flutter` is NOT configured in `pubspec.yaml`.
15+
- Allows to be configured for legacy `dartanalyzer` if required (`DARTANALYZER`)
16+
- Allows to be configured for pre-existing analysis reports (`MANUAL`)
17+
- Renamed `sonar.dart.analysis.useExistingOptions` to `sonar.dart.analyzer.options.override`, now defaults to `true`
18+
- Renamed `sonar.dart.analysis.reportPath` to `sonar.dart.analyzer.report.path` - this is only evaluated when `sonar.dart.analyzer.mode`is set to `MANUAL`
19+
- Added `sonar.dart.analyzer.report.mode` option
20+
- Available options `DETECT|MACHINE|LEGACY`
21+
- Defaults to automatic detection by parsing the Dart SDK version and defaults to `--format=machine` for Dart when SDK >= 2.12
22+
- Can be set to legacy mode when using pre-existing analysis report or an older Dart SDK
23+
24+
#### Experimental
25+
26+
- None.
27+
28+
#### Enhancements
29+
30+
- Add a `pubspec.yaml` sensor which adds the file to SonarQube and allow showing lints for this file
31+
- Add support for multi-module projects (`sonar.modules=mylib,mylib_generator,example`)
32+
- Added missing dart keywords and corrected some
33+
- `try`
34+
- `hide`
35+
- `show`
36+
- `late`
37+
- `of`
38+
- `continue`
39+
- `covariant`
40+
- `out`
41+
- `do`
42+
- `dynamic`
43+
- `native`
44+
- Rules update
45+
- Better rules description
46+
47+
#### Bug Fixes
48+
49+
- None.
450

551
## 0.3.2
652

CONTRIBUTING.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Contributing
2+
3+
This documentation is a guide for plugin developers / contributors.
4+
5+
## Requirements
6+
7+
- Java JDK 11+
8+
- Maven 3.8 or later
9+
- A local SonarQube instance for local testing
10+
11+
## Main commands
12+
13+
#### Add missing license headers on source files
14+
15+
```bash
16+
$ mvn license:format
17+
```
18+
19+
#### Local plugin deployment
20+
21+
In order to start the plugin, SONARQUBE_HOME environment variable must be set
22+
23+
If variable is already set, use:
24+
```bash
25+
$ mvn install
26+
```
27+
28+
If variable is not set, it can be set inline:
29+
```bash
30+
$ SONARQUBE_HOME=~/path/to/sonarqube mvn install
31+
```
32+
33+
When started locally SonarQube UI is available at http://localhost:9000
34+
35+
#### Packaging
36+
37+
```bash
38+
$ mvn package
39+
```
40+
41+
## Updating rules
42+
43+
The plugin rules are based on external linters such as dartanalyzer.
44+
45+
When a new version of the linter (with new rules) is released, the matching repositoryRule repository must be updated as well in order to include the new rules.
46+
47+
This update is mostly automatic with the execution of a Groovy script.
48+
49+
### dartanalyzer update
50+
51+
Use the following command to update the SwiftLint rules file:
52+
53+
```bash
54+
$ mvn groovy:execute -Dsource=scripts/updateDartAnalyzerRules.groovy
55+
```
56+
57+
### Filling rules information
58+
59+
Eventhough updating rule repository file is mostly automatic, some data related to rules cannot be automatically computed.
60+
61+
This is the case for :
62+
- severity (blocker, critical, major, minor, info)
63+
- type (code smell, bug, vulnerability)
64+
- debt (remediation effort estimate, optional)
65+
66+
At the end of a rule update script, rules are scanned, and you are asked to fill missing information:
67+
68+
```console
69+
Missing information on rule always_use_package_imports
70+
Avoid relative imports for files in lib/.
71+
72+
Severity? (1 = BLOCKER, 2 = CRITICAL, 3 = MAJOR, 4 = MINOR, 5 = INFO)
73+
3
74+
MAJOR
75+
Type? (1 = CODE_SMELL, 2 = BUG, 3 = VULNERABILITY, 4 = SECURITY_HOTSPOT)
76+
1
77+
CODE_SMELL
78+
Remediation time? (in minutes)
79+
5
80+
5min
81+
```
82+
> **Warning**
83+
> By default, rules manually processed are limited to 20 (defined in the `scripts.max-manual`property of the `pom.xml`) per run.
84+
> If there are more than 20 rules to fill manually, launch the script again to process next rules.
85+
86+
## Releasing
87+
88+
### Snapshots
89+
90+
Every push to `develop` branch updates the matching snapshot release.
91+
92+
For example: if project version is set to `0.1-SNAPSHOT` on`develop`. A `0.1-SNAPSHOT` will be released (or release will be updated if it already exists) as soon as the `maven.yml` GitHub actions workflow finishes.
93+
94+
### Stable
95+
96+
A new stable release is pushed on GitHub, on every new tag creation (performed by the `release.yml` GitHub Actions workflow).
97+
98+
The steps to issue a new stable release are:
99+
1. Merge `develop` branch to `main`branch (do not squash in order to keep commit history).
100+
2. Create a new tag from `main` branch with a naming matching the release number. Example:
101+
```bash
102+
$ git tag -a 0.1.0
103+
```
104+
3. Push the new tag with:
105+
```bash
106+
$ git push --tags
107+
```
108+
109+
Once released, remember to update the project version on the `develop`branch to a new snapshot number:
110+
```bash
111+
$ mvn versions:set -DnewVersion=0.2-SNAPSHOT
112+
```
113+

0 commit comments

Comments
 (0)