Skip to content

Commit 2823a12

Browse files
author
Philippe Bernery
committed
Merge branch 'develop'
2 parents ad24cab + ac6fd1b commit 2823a12

File tree

6 files changed

+246
-47
lines changed

6 files changed

+246
-47
lines changed

README.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ In SonarQube under Quality Profiles the used Linter can be specified by selectin
2323
<img src="SwitchProfiles.png" alt="Set preferred profile (SwiftLint or Tailor) to default in SonarQube." width="100%"/>
2424
</p>
2525

26-
###Features
26+
### Features
2727

2828
| Feature | Supported | MacOS | Unix |
2929
|---------------|----------|:-----------:|:-----------:|
@@ -37,78 +37,85 @@ In SonarQube under Quality Profiles the used Linter can be specified by selectin
3737
| Code coverage |YES | Uses [slather](https://github.com/venmo/slather) | Not Supported|
3838

3939

40-
###Download
40+
### Download
4141

4242
Checkout the [Releases](https://github.com/Backelite/sonar-swift/releases) page.
4343

44-
###Launching an analysis
44+
### Launching an analysis
4545
If you use [Fastlane](https://fastlane.tools), please read [our Fastlane integration doc](docs/sonarqube-fastlane.md).
4646
Otherwise, run the ```run-sonar-swift.sh``` script from your Xcode project root folder
4747

48-
###Release history
48+
### Release history
4949

50-
####0.3.2
50+
#### 0.3.4
51+
- SwiftLint 0.18.1 (add 8 more rules)
52+
- Fix README headers
53+
- Update README URLs to SonarQube
54+
55+
#### 0.3.3
56+
- Updated run-sonar-swift.sh to support -usesonarscanner (for sonar-scanner instead of sonar-runner).
57+
58+
#### 0.3.2
5159
- SwiftLint 0.16.1 (75 rules now).
5260
- Fixed [Metric 'test_data' should not be computed by a Sensor](https://github.com/Backelite/sonar-swift/issues/61) with SonarQube 6.2
5361
- Fastlane documentation update by [mammuth](https://github.com/mammuth). See [PR 62](https://github.com/Backelite/sonar-swift/pull/62)
5462
- run-sonar-swift.sh fix by [TheSkwiggs](https://github.com/mammuth). See [PR 64](https://github.com/Backelite/sonar-swift/pull/64)
5563

56-
####0.3.1
64+
#### 0.3.1
5765
- Now falls back to sonar-scanner if sonar-runner is not installed (thanks to [MaikoHermans](https://github.com/MaikoHermans). See [PR 59](https://github.com/Backelite/sonar-swift/pull/59))
5866
- Ability to set *sonar.swift.appName*. Useful when basename is different from targeted scheme, or when slather fails with 'No product binary found' (thanks to [MaikoHermans](https://github.com/MaikoHermans). See [PR 58](https://github.com/Backelite/sonar-swift/pull/58))
5967
- Added a second linter: Tailor. Enables analysis of Swift code on linux. (thanks to [tzwickl](https://github.com/tzwickl) for the hard work. See [PR 51](https://github.com/Backelite/sonar-swift/pull/51))
6068

6169

62-
####0.3.0
70+
#### 0.3.0
6371
- SonarQube 6 support. Important : will work with SonarQube 5.x and above only. Will not work anymore with SonarQube 4.5.x anymore.
6472
- SwiftLint 0.13.1 support (49 rules now).
6573
- Desactivation of unit tests and coverage is now allowed. Use **run-sonar-swift.sh -nounittests** to do it.
6674

67-
####0.2.4
75+
#### 0.2.4
6876
- Analysis does not fail anymore when an unkwown issue is reported by SwiftLint. See [issue 35](https://github.com/Backelite/sonar-swift/issues/35)
6977
- Fastlane documentation (thanks to [viteinfinite](https://github.com/viteinfinite)). See [PR 33](https://github.com/Backelite/sonar-swift/pull/33)
7078
- Fixed Fastlane JUnit report support
7179
- SwiftLint 0.11.1 support
7280
- Better return code suppot for run-sonar-swift.sh
7381

74-
####0.2.3
82+
#### 0.2.3
7583
- Fixed Lizard Sensor wrong file path
7684

77-
####0.2.2
85+
#### 0.2.2
7886
- Added support for .xcodeproj only projects (thanks to [delannoyk](https://github.com/delannoyk))
7987
- Fix for Lizard Sensor to find indexed files (thanks to [gretzki](https://github.com/gretzki))
8088
- Got rid of confusion with commercial plugin in the update center
8189

82-
####0.2.1
90+
#### 0.2.1
8391
- SwiftLint 0.8 support (new rules added).
8492

85-
####0.2.0
93+
#### 0.2.0
8694
- Lizard complexity report support (thanks to [akshaysyaduvanshi](https://github.com/akshaysyaduvanshi))
8795

88-
####0.1.2
96+
#### 0.1.2
8997
- SwiftLint 0.5.1 support (new rules added).
9098
- Added *sonar.swift.simulator* key in *sonar-project.properties* to select destination simulator for running tests
9199
- SwiftLint scans source directories only
92100

93-
####0.1.1
101+
#### 0.1.1
94102
- SwiftLint 0.4.0 support (new rules added).
95103

96-
####0.1.0
104+
#### 0.1.0
97105
- Initial release.
98106

99107

100-
101-
###Prerequisites
108+
### Prerequisites
102109

103110
- a Mac with Xcode 7 or +
104-
- [SonarQube](http://docs.codehaus.org/display/SONAR/Setup+and+Upgrade) and [SonarQube Runner](http://docs.codehaus.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner) installed ([HomeBrew](http://brew.sh) installed and ```brew install sonar-runner```)
111+
- [SonarQube](https://docs.sonarqube.org/display/SONAR/Setup+and+Upgrade) and [SonarQube Scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner)
105112
- [xcpretty](https://github.com/supermarin/xcpretty) (see instructions below)
106113
- [SwiftLint](https://github.com/realm/SwiftLint) ([HomeBrew](http://brew.sh) installed and ```brew install swiftlint```). Version 0.3.0 or above.
107114
- [Tailor](https://github.com/sleekbyte/tailor) ([HomeBrew](http://brew.sh) installed and ```brew install tailor```). Version 0.11.1 or above.
108115
- [slather](https://github.com/SlatherOrg/slather) (```gem install slather```). Version 2.1.0 or above.
109116
- [lizard](https://github.com/terryyin/lizard) ([PIP](https://pip.pypa.io/en/stable/installing/) installed and ```sudo pip install lizard```)
110117

111-
###Installation of xcpretty with JUnit reports fix
118+
### Installation of xcpretty with JUnit reports fix
112119

113120
At the time, xcpretty needs to be fixed to work with SonarQube.
114121

@@ -120,29 +127,29 @@ To install the fixed version, follow those steps :
120127
gem build xcpretty.gemspec
121128
sudo gem install --both xcpretty-0.2.2.gem
122129

123-
###Installation (once for all your Swift projects)
130+
### Installation (once for all your Swift projects)
124131
- Download the plugin binary into the $SONARQUBE_HOME/extensions/plugins directory
125132
- Copy [run-sonar-swift.sh](https://rawgithub.com/Backelite/sonar-swift/master/src/main/shell/run-sonar-swift.sh) somewhere in your PATH
126133
- Restart the SonarQube server.
127134

128-
###Configuration (once per project)
135+
### Configuration (once per project)
129136
- Copy [sonar-project.properties](https://raw.githubusercontent.com/Backelite/sonar-swift/master/sonar-project.properties) in your Xcode project root folder (along your .xcodeproj file)
130137
- Edit the ```sonar-project.properties``` file to match your Xcode iOS/MacOS project
131138

132139
**The good news is that you don't have to modify your Xcode project to enable SonarQube!**. Ok, there might be one needed modification if you don't have a specific scheme for your test target, but that's all.
133140

134-
###Update (once per plugin update)
141+
### Update (once per plugin update)
135142
- Install the lastest plugin version
136143
- Copy ```run-sonar-swift.sh``` somewhere in your PATH
137144

138145
If you still have *run-sonar-swift.sh* file in each of your project (not recommended), you will need to update all those files.
139146

140-
###Contributing
147+
### Contributing
141148

142149
Feel free to contribute to this plugin by issuing pull requests to this repository.
143150

144151
When creating a pull request: always create it for the *develop* branch.
145152

146-
###License
153+
### License
147154

148155
SonarQube Plugin for Swift is released under the [GNU LGPL 3 license](http://www.gnu.org/licenses/lgpl.txt).

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<groupId>com.backelite.sonarqube</groupId>
2828
<artifactId>backelite-sonar-swift-plugin</artifactId>
29-
<version>0.3.2</version>
29+
<version>0.3.4</version>
3030

3131
<packaging>sonar-plugin</packaging>
3232

src/main/resources/com/sonar/sqale/swiftlint-model.xml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,110 @@
894894
<txt>min</txt>
895895
</prop>
896896
</chc>
897+
<chc>
898+
<rule-repo>SwiftLint</rule-repo>
899+
<rule-key>discarded_notification_center_observer</rule-key>
900+
<prop>
901+
<key>remediationFunction</key>
902+
<txt>CONSTANT_ISSUE</txt>
903+
</prop>
904+
<prop>
905+
<key>offset</key>
906+
<val>5</val>
907+
<txt>min</txt>
908+
</prop>
909+
</chc>
910+
<chc>
911+
<rule-repo>SwiftLint</rule-repo>
912+
<rule-key>explicit_type_interface</rule-key>
913+
<prop>
914+
<key>remediationFunction</key>
915+
<txt>CONSTANT_ISSUE</txt>
916+
</prop>
917+
<prop>
918+
<key>offset</key>
919+
<val>5</val>
920+
<txt>min</txt>
921+
</prop>
922+
</chc>
923+
<chc>
924+
<rule-repo>SwiftLint</rule-repo>
925+
<rule-key>fatal_error_message</rule-key>
926+
<prop>
927+
<key>remediationFunction</key>
928+
<txt>CONSTANT_ISSUE</txt>
929+
</prop>
930+
<prop>
931+
<key>offset</key>
932+
<val>5</val>
933+
<txt>min</txt>
934+
</prop>
935+
</chc>
936+
<chc>
937+
<rule-repo>SwiftLint</rule-repo>
938+
<rule-key>for_where</rule-key>
939+
<prop>
940+
<key>remediationFunction</key>
941+
<txt>CONSTANT_ISSUE</txt>
942+
</prop>
943+
<prop>
944+
<key>offset</key>
945+
<val>5</val>
946+
<txt>min</txt>
947+
</prop>
948+
</chc>
949+
<chc>
950+
<rule-repo>SwiftLint</rule-repo>
951+
<rule-key>identifier_name</rule-key>
952+
<prop>
953+
<key>remediationFunction</key>
954+
<txt>CONSTANT_ISSUE</txt>
955+
</prop>
956+
<prop>
957+
<key>offset</key>
958+
<val>5</val>
959+
<txt>min</txt>
960+
</prop>
961+
</chc>
962+
<chc>
963+
<rule-repo>SwiftLint</rule-repo>
964+
<rule-key>implicitly_unwrapped_optional</rule-key>
965+
<prop>
966+
<key>remediationFunction</key>
967+
<txt>CONSTANT_ISSUE</txt>
968+
</prop>
969+
<prop>
970+
<key>offset</key>
971+
<val>5</val>
972+
<txt>min</txt>
973+
</prop>
974+
</chc>
975+
<chc>
976+
<rule-repo>SwiftLint</rule-repo>
977+
<rule-key>notification_center_detachment</rule-key>
978+
<prop>
979+
<key>remediationFunction</key>
980+
<txt>CONSTANT_ISSUE</txt>
981+
</prop>
982+
<prop>
983+
<key>offset</key>
984+
<val>5</val>
985+
<txt>min</txt>
986+
</prop>
987+
</chc>
988+
<chc>
989+
<rule-repo>SwiftLint</rule-repo>
990+
<rule-key>redundant_discardable_let</rule-key>
991+
<prop>
992+
<key>remediationFunction</key>
993+
<txt>CONSTANT_ISSUE</txt>
994+
</prop>
995+
<prop>
996+
<key>offset</key>
997+
<val>5</val>
998+
<txt>min</txt>
999+
</prop>
1000+
</chc>
8971001
</chc>
8981002
</chc>
8991003
<chc>

src/main/resources/org/sonar/plugins/swiftlint/profile-swiftlint.xml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
<repositoryKey>SwiftLint</repositoryKey>
5656
<key>cyclomatic_complexity</key>
5757
</rule>
58+
<rule>
59+
<repositoryKey>SwiftLint</repositoryKey>
60+
<key>discarded_notification_center_observer</key>
61+
</rule>
5862
<rule>
5963
<repositoryKey>SwiftLint</repositoryKey>
6064
<key>dynamic_inline</key>
@@ -75,6 +79,14 @@
7579
<repositoryKey>SwiftLint</repositoryKey>
7680
<key>explicit_init</key>
7781
</rule>
82+
<rule>
83+
<repositoryKey>SwiftLint</repositoryKey>
84+
<key>explicit_type_interface</key>
85+
</rule>
86+
<rule>
87+
<repositoryKey>SwiftLint</repositoryKey>
88+
<key>fatal_error_message</key>
89+
</rule>
7890
<rule>
7991
<repositoryKey>SwiftLint</repositoryKey>
8092
<key>file_header</key>
@@ -87,6 +99,10 @@
8799
<repositoryKey>SwiftLint</repositoryKey>
88100
<key>first_where</key>
89101
</rule>
102+
<rule>
103+
<repositoryKey>SwiftLint</repositoryKey>
104+
<key>for_where</key>
105+
</rule>
90106
<rule>
91107
<repositoryKey>SwiftLint</repositoryKey>
92108
<key>force_cast</key>
@@ -111,10 +127,18 @@
111127
<repositoryKey>SwiftLint</repositoryKey>
112128
<key>generic_type_name</key>
113129
</rule>
130+
<rule>
131+
<repositoryKey>SwiftLint</repositoryKey>
132+
<key>identifier_name</key>
133+
</rule>
114134
<rule>
115135
<repositoryKey>SwiftLint</repositoryKey>
116136
<key>implicit_getter</key>
117137
</rule>
138+
<rule>
139+
<repositoryKey>SwiftLint</repositoryKey>
140+
<key>implicitly_unwrapped_optional</key>
141+
</rule>
118142
<rule>
119143
<repositoryKey>SwiftLint</repositoryKey>
120144
<key>large_tuple</key>
@@ -159,6 +183,10 @@
159183
<repositoryKey>SwiftLint</repositoryKey>
160184
<key>nimble_operator</key>
161185
</rule>
186+
<rule>
187+
<repositoryKey>SwiftLint</repositoryKey>
188+
<key>notification_center_detachment</key>
189+
</rule>
162190
<rule>
163191
<repositoryKey>SwiftLint</repositoryKey>
164192
<key>number_separator</key>
@@ -195,6 +223,10 @@
195223
<repositoryKey>SwiftLint</repositoryKey>
196224
<key>prohibited_super_call</key>
197225
</rule>
226+
<rule>
227+
<repositoryKey>SwiftLint</repositoryKey>
228+
<key>redundant_discardable_let</key>
229+
</rule>
198230
<rule>
199231
<repositoryKey>SwiftLint</repositoryKey>
200232
<key>redundant_nil_coalescing</key>
@@ -283,10 +315,6 @@
283315
<repositoryKey>SwiftLint</repositoryKey>
284316
<key>valid_ibinspectable</key>
285317
</rule>
286-
<rule>
287-
<repositoryKey>SwiftLint</repositoryKey>
288-
<key>variable_name</key>
289-
</rule>
290318
<rule>
291319
<repositoryKey>SwiftLint</repositoryKey>
292320
<key>vertical_parameter_alignment</key>

0 commit comments

Comments
 (0)