-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add formatting, re-format according to rules (#17)
- Loading branch information
Showing
22 changed files
with
573 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# IDE Config and Code Style | ||
|
||
This project has a strictly enforced code style. Code formatting is done by the Eclipse code | ||
formatter, using the config files found in the `build-tools` directory. By | ||
default when you run `mvn install` the code will be formatted automatically. When submitting a | ||
pull request the CI build will fail if running the formatter results in any code changes, so it is | ||
recommended that you always run a full Maven build before submitting a pull request. | ||
|
||
If you want to run the formatting without doing a full build, you can run `mvn process-sources`. | ||
|
||
#### Eclipse Setup | ||
|
||
Open the *Preferences* window, and then navigate to _Java_ -> _Code Style_ -> _Formatter_. Click _ | ||
Import_ and then select the `eclipse-format.xml` file in the `build-tools` | ||
directory. | ||
|
||
Next navigate to _Java_ -> _Code Style_ -> _Organize Imports_. Click _Import_ and select | ||
the `eclipse.importorder` file. | ||
|
||
#### IDEA Setup | ||
|
||
Open the _Preferences_ window (or _Settings_ depending on your edition), navigate to _Plugins_ and | ||
install | ||
the [Eclipse Code Formatter Plugin](https://plugins.jetbrains.com/plugin/6546-eclipse-code-formatter) | ||
from the Marketplace. | ||
|
||
Restart your IDE, open the *Preferences* (or *Settings*) window again and navigate to _Other | ||
Settings_ -> _Eclipse Code Formatter_. | ||
|
||
Select _Use the Eclipse Code Formatter_, then change the _Eclipse Java Formatter Config File_ to | ||
point to the | ||
`eclipse-format.xml` file in the `build-tools` directory. Make sure the _ | ||
Optimize Imports_ box is ticked, and select the `eclipse.importorder` file as the import order | ||
config file. | ||
|
||
Next, disable wildcard imports: | ||
navigate to _Editor_ -> _Code Style_ -> _Java_ -> _Imports_ | ||
and set _Class count to use import with '\*'_ to `999`. Do the same with _Names count to use static | ||
import with '\*'_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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> | ||
|
||
<parent> | ||
<groupId>io.github.metacosm</groupId> | ||
<artifactId>power-server-parent</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>build-tools</artifactId> | ||
|
||
|
||
</project> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#Organize Import Order | ||
#Wed Jan 23 12:03:29 AEDT 2019 | ||
0=java | ||
1=javax | ||
2=jakarta | ||
3=org | ||
4=com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
metadata/src/main/java/io/github/metacosm/power/SensorMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
server/src/main/java/io/github/metacosm/power/PowerMeasurer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
server/src/main/java/io/github/metacosm/power/PowerResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
server/src/main/java/io/github/metacosm/power/sensors/Measures.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
server/src/main/java/io/github/metacosm/power/sensors/PowerSensor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
server/src/main/java/io/github/metacosm/power/sensors/PowerSensorProducer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.