Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable spotless formatter #7449

Merged
merged 9 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.java text=auto
.xml text=auto
6 changes: 4 additions & 2 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -118,7 +120,7 @@
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.bosesoundtouch</artifactId>
<version>${project.version}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.bsblan</artifactId>
Expand Down
4 changes: 3 additions & 1 deletion bom/openhab-core-index/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down
13 changes: 9 additions & 4 deletions bom/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -37,11 +39,14 @@
</goals>
<configuration>
<target>
<copy file="${basedirRoot}/../../bundles/pom.xml" overwrite="true" tofile="${basedirRoot}/../../bom/openhab-addons/pom.xml"/>
<copy file="${basedirRoot}/../../bundles/pom.xml" overwrite="true"
tofile="${basedirRoot}/../../bom/openhab-addons/pom.xml"/>
<!-- rewrite footer -->
<replaceregexp file="${basedirRoot}/../../bom/openhab-addons/pom.xml" match="/modules[\s\S]*dependencies&gt;" replace="/dependencies&gt;"/>
<replaceregexp file="${basedirRoot}/../../bom/openhab-addons/pom.xml"
match="/modules[\s\S]*dependencies&gt;" replace="/dependencies&gt;"/>
<!-- rewrite header -->
<replaceregexp file="${basedirRoot}/../../bom/openhab-addons/pom.xml" match="\S*parent[\s\S]*modules&gt;\S*" replace="header"/>
<replaceregexp file="${basedirRoot}/../../bom/openhab-addons/pom.xml"
match="\S*parent[\s\S]*modules&gt;\S*" replace="header"/>
<replace file="{basedirRoot}/../../bom/openhab-addons/pom.xml">
<replacetoken>header</replacetoken>
<replacevalue><![CDATA[<parent>
Expand Down
4 changes: 3 additions & 1 deletion bom/runtime-index/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 3 additions & 1 deletion bom/test-index/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down
88 changes: 44 additions & 44 deletions bundles/create_openhab_binding_skeleton.cmd
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
@echo off

SETLOCAL
SET ARGC=0

FOR %%x IN (%*) DO SET /A ARGC+=1

IF %ARGC% NEQ 3 (
echo Usage: %0 BindingIdInCamelCase Author GithubUser
exit /B 1
)

SET OpenhabCoreVersion="2.5.0"
SET OpenhabVersion="2.5.5-SNAPSHOT"

SET BindingIdInCamelCase=%~1
SET BindingIdInLowerCase=%BindingIdInCamelCase%
SET Author=%~2
SET GithubUser=%~3

call :LoCase BindingIdInLowerCase

call mvn -s archetype-settings.xml archetype:generate -N -DarchetypeGroupId=org.openhab.core.tools.archetypes -DarchetypeArtifactId=org.openhab.core.tools.archetypes.binding -DarchetypeVersion=%OpenhabCoreVersion% -DgroupId=org.openhab.binding -DartifactId=org.openhab.binding.%BindingIdInLowerCase% -Dpackage=org.openhab.binding.%BindingIdInLowerCase% -Dversion=%OpenhabVersion% -DbindingId=%BindingIdInLowerCase% -DbindingIdCamelCase=%BindingIdInCamelCase% -DvendorName=openHAB -Dnamespace=org.openhab -Dauthor="%Author%" -DgithubUser="%GithubUser%"

COPY ..\src\etc\NOTICE org.openhab.binding.%BindingIdInLowerCase%\

:: temporary fix
:: replace ${project.version} by ${ohc.version} in src/main/feature/feature.xml
@powershell -command "(Get-Content org.openhab.binding.$env:BindingIdInLowerCase/src/main/feature/feature.xml).replace('-core/${project.version}', '-core/${ohc.version}') | Set-Content org.openhab.binding.$env:BindingIdInLowerCase/src/main/feature/feature.xml"

(SET BindingIdInLowerCase=)
(SET BindingIdInCamelCase=)
(SET Author=)
(SET GithubUser=)

GOTO:EOF

:LoCase
:: Subroutine to convert a variable VALUE to all lower case.
:: The argument for this subroutine is the variable NAME.
FOR %%i IN ("A=a" "B=b" "C=c" "D=d" "E=e" "F=f" "G=g" "H=h" "I=i" "J=j" "K=k" "L=l" "M=m" "N=n" "O=o" "P=p" "Q=q" "R=r" "S=s" "T=t" "U=u" "V=v" "W=w" "X=x" "Y=y" "Z=z") DO CALL SET "%1=%%%1:%%~i%%"
GOTO:EOF

ENDLOCAL
@echo off

SETLOCAL
SET ARGC=0

FOR %%x IN (%*) DO SET /A ARGC+=1

IF %ARGC% NEQ 3 (
echo Usage: %0 BindingIdInCamelCase Author GithubUser
exit /B 1
)

SET OpenhabCoreVersion="2.5.0"
SET OpenhabVersion="2.5.5-SNAPSHOT"

SET BindingIdInCamelCase=%~1
SET BindingIdInLowerCase=%BindingIdInCamelCase%
SET Author=%~2
SET GithubUser=%~3

call :LoCase BindingIdInLowerCase

call mvn -s archetype-settings.xml archetype:generate -N -DarchetypeGroupId=org.openhab.core.tools.archetypes -DarchetypeArtifactId=org.openhab.core.tools.archetypes.binding -DarchetypeVersion=%OpenhabCoreVersion% -DgroupId=org.openhab.binding -DartifactId=org.openhab.binding.%BindingIdInLowerCase% -Dpackage=org.openhab.binding.%BindingIdInLowerCase% -Dversion=%OpenhabVersion% -DbindingId=%BindingIdInLowerCase% -DbindingIdCamelCase=%BindingIdInCamelCase% -DvendorName=openHAB -Dnamespace=org.openhab -Dauthor="%Author%" -DgithubUser="%GithubUser%"

COPY ..\src\etc\NOTICE org.openhab.binding.%BindingIdInLowerCase%\

:: temporary fix
:: replace ${project.version} by ${ohc.version} in src/main/feature/feature.xml
@powershell -command "(Get-Content org.openhab.binding.$env:BindingIdInLowerCase/src/main/feature/feature.xml).replace('-core/${project.version}', '-core/${ohc.version}') | Set-Content org.openhab.binding.$env:BindingIdInLowerCase/src/main/feature/feature.xml"

(SET BindingIdInLowerCase=)
(SET BindingIdInCamelCase=)
(SET Author=)
(SET GithubUser=)

GOTO:EOF

:LoCase
:: Subroutine to convert a variable VALUE to all lower case.
:: The argument for this subroutine is the variable NAME.
FOR %%i IN ("A=a" "B=b" "C=c" "D=d" "E=e" "F=f" "G=g" "H=h" "I=i" "J=j" "K=k" "L=l" "M=m" "N=n" "O=o" "P=p" "Q=q" "R=r" "S=s" "T=t" "U=u" "V=v" "W=w" "X=x" "Y=y" "Z=z") DO CALL SET "%1=%%%1:%%~i%%"
GOTO:EOF

ENDLOCAL
4 changes: 3 additions & 1 deletion bundles/org.openhab.binding.adorne/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,4 @@ public void refresh() {
super.refresh();
refreshBrightness();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

<thing-type id="switch">
<supported-bridge-type-refs>
<bridge-type-ref id="hub" />
<bridge-type-ref id="hub"/>
</supported-bridge-type-refs>

<label>Adorne Switch</label>
<description>Controls an Adorne switch or outlet.</description>

<channels>
<channel id="power" typeId="system.power" />
<channel id="power" typeId="system.power"/>
</channels>

<config-description>
Expand All @@ -25,15 +25,15 @@

<thing-type id="dimmer">
<supported-bridge-type-refs>
<bridge-type-ref id="hub" />
<bridge-type-ref id="hub"/>
</supported-bridge-type-refs>

<label>Adorne Dimmer Switch</label>
<description>Controls an Adorne dimmer switch.</description>

<channels>
<channel id="power" typeId="system.power" />
<channel id="brightness" typeId="system.brightness" />
<channel id="power" typeId="system.power"/>
<channel id="brightness" typeId="system.brightness"/>
</channels>

<config-description>
Expand Down
4 changes: 3 additions & 1 deletion bundles/org.openhab.binding.airquality/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.airquality-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-airquality" description="Air Quality Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.airquality/${project.version}</bundle>
</feature>
<feature name="openhab-binding-airquality" description="Air Quality Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.airquality/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,4 @@ public class AirQualityBindingConstants {
public static final Unit<Temperature> API_TEMPERATURE_UNIT = SIUnits.CELSIUS;
public static final Unit<Dimensionless> API_HUMIDITY_UNIT = SmartHomeUnits.PERCENT;
public static final Unit<Pressure> API_PRESSURE_UNIT = HECTO(SIUnits.PASCAL);

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ public class AirQualityConfiguration {
public String location;
public Integer stationId;
public Integer refresh;

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ protected ThingHandler createHandler(Thing thing) {

return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,4 @@ protected void setLocationProvider(LocationProvider locationProvider) {
protected void unsetLocationProvider(LocationProvider locationProvider) {
this.locationProvider = null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -318,5 +318,4 @@ public static Object getValue(String channelId, AirQualityJsonResponse data) thr

return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ public String getGeo() {
}
return String.join(",", list);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,4 @@ public String getAqiDescription() {
public String getDominentPol() {
return dominentpol;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,4 @@ public BigDecimal getH() {
public BigDecimal getW() {
return wind.getValue();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ public String getStatus() {
public AirQualityJsonData getData() {
return data;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ public ZonedDateTime getObservationTime() throws Exception {
ZonedDateTime observationTime = ZonedDateTime.parse(fullString);
return observationTime;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ public String getName() {
public void setName(String name) {
this.name = name;
}

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<binding:binding id="airquality"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:binding="https://openhab.org/schemas/binding/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd">
<binding:binding id="airquality" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:binding="https://openhab.org/schemas/binding/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd">

<name>Air Quality Binding</name>
<description>Measure Air Quality Index and details about pollution particles for a given location</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="airquality" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<thing:thing-descriptions bindingId="airquality"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">

<!-- Air Quality Thing -->
<thing-type id="aqi">
<label>Air Quality</label>
<description>
Provides various air quality data from the World Air Quality Project.
In order to receive the data, you must register an account on http://aqicn.org/data-platform/token/ and get your API token.
Provides various air quality data from the World Air Quality Project.
In order to receive the data, you
must register an account on http://aqicn.org/data-platform/token/ and get your API
token.
</description>

<channels>
<channel id="aqiLevel" typeId="aqiLevel" />
<channel id="aqiDescription" typeId="aqiDescription" />
<channel id="pm25" typeId="pm25" />
<channel id="pm10" typeId="pm10" />
<channel id="o3" typeId="o3" />
<channel id="no2" typeId="no2" />
<channel id="co" typeId="co" />
<channel id="so2" typeId="so2" />
<channel id="locationName" typeId="locationName" />
<channel id="stationLocation" typeId="stationLocation" />
<channel id="stationId" typeId="stationId" />
<channel id="observationTime" typeId="observationTime" />
<channel id="temperature" typeId="temperature" />
<channel id="pressure" typeId="pressure" />
<channel id="humidity" typeId="humidity" />
<channel id="dominentpol" typeId="dominentPol" />
<channel id="aqiLevel" typeId="aqiLevel"/>
<channel id="aqiDescription" typeId="aqiDescription"/>
<channel id="pm25" typeId="pm25"/>
<channel id="pm10" typeId="pm10"/>
<channel id="o3" typeId="o3"/>
<channel id="no2" typeId="no2"/>
<channel id="co" typeId="co"/>
<channel id="so2" typeId="so2"/>
<channel id="locationName" typeId="locationName"/>
<channel id="stationLocation" typeId="stationLocation"/>
<channel id="stationId" typeId="stationId"/>
<channel id="observationTime" typeId="observationTime"/>
<channel id="temperature" typeId="temperature"/>
<channel id="pressure" typeId="pressure"/>
<channel id="humidity" typeId="humidity"/>
<channel id="dominentpol" typeId="dominentPol"/>
</channels>

<config-description>
Expand Down Expand Up @@ -130,7 +133,7 @@
<label>Station Location</label>
<description>Location of the measuring station</description>
<category>Station Location</category>
<state readOnly="true" pattern="%2$s°N,%3$s°W" />
<state readOnly="true" pattern="%2$s°N,%3$s°W"/>
</channel-type>

<channel-type id="stationId" advanced="true">
Expand Down Expand Up @@ -170,14 +173,13 @@
<label>Humidity</label>
<description>Current humidity</description>
<category>Humidity</category>
<state readOnly="true" min="0" max="100" pattern="%.2f %unit%" />
<state readOnly="true" min="0" max="100" pattern="%.2f %unit%"/>
</channel-type>

<channel-type id="dominentPol">
<item-type>String</item-type>
<label>Dominent Polutor</label>
<state readOnly="true" pattern="%s"/>
</channel-type>

</thing:thing-descriptions>

4 changes: 3 additions & 1 deletion bundles/org.openhab.binding.airvisualnode/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down
Loading