From 875f871c6688593722c8ffc96ee4869f765060fe Mon Sep 17 00:00:00 2001 From: Frank Delporte Date: Fri, 29 May 2020 23:55:49 +0200 Subject: [PATCH 1/2] added initial editor config for code style + README additions --- .editorconfig | 20 ++++++++++++++++++++ README.md | 45 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..7ed469669 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = false +max_line_length = 120 +tab_width = 2 + +[*.java] +indent_size = 4 +tab_width = 4 +ij_java_blank_lines_after_imports = 1 +ij_java_blank_lines_before_imports = 1 + +[{*.ant,*.bpmn,*.fxml,*.jhm,*.jnlp,*.jrxml,*.plan,*.pom,*.rng,*.tld,*.wadl,*.wsdd,*.wsdl,*.xjb,*.xml,*.xsd,*.xsl,*.xslt,*.xul}] +indent_size = 4 +tab_width = 4 diff --git a/README.md b/README.md index 9b832b35c..32155219f 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,36 @@ Snapshot builds are available from: * [Sonatype OSS] https://oss.sonatype.org/index.html#nexus-search;quick~pi4j * [Downloads] https://pi4j.com/download.html +Copyright (C) 2012-2020 Pi4J -Copyright (C) 2012-2019 Pi4J +## CONTRIBUTING TO PI4J + +### Adding a feature or solving a problem + +If you have and idea to extend and improve Pi4J, please first create a ticket to discuss how +it fits in the project and how it can be implemented. + +If you find a bug, create a ticket, so we are aware of it and others with the same problem can +contribute what they already investigated. And the quickest way to get a fix? Try to search for +the cause of the problem or even better provide a code fix! + +### Code styling + +To prevent unnecessary code (tabs versus spaces, number of characters per line...) we have +defined an [editorconfig](.editorconfig) for IntelliJ IDEA. You can find [more info +here](https://www.jetbrains.com/help/idea/configuring-code-style.html) about its use. + +Some tips to keep the code clean and readable: +* Short methods with a clear name +* Use SonarLint to get improvement tips while code +* Use shortcuts + * CTRL+ALT+L: Reformat code + * CTRL+ALT+O: Optimize imports + +### Join the team + +You want to become a member of the Pi4J-team? Great idea! Send a short message to frank@pi4j.com +with your experience, ideas, and what you would like to contribute to the project. ## LICENSE @@ -45,12 +73,19 @@ Copyright (C) 2012-2019 Pi4J See the License for the specific language governing permissions and limitations under the License. - ## PROJECT OVERVIEW - Starting with the Pi4J 2.0 builds, the Pi4J project is prioritizing focus - on providing Java programs access, control and communication with the core - I/O capabilities of the Raspberry Pi platform. Earlier versions of Pi4J +Starting with the Pi4J 2.0 builds, the Pi4J project is prioritizing focus +on providing Java programs access, control and communication with the core +I/O capabilities of the Raspberry Pi platform. + +**LINK BELOW TO BE CHANGED TO pi4j.com WHEN NEW SITE IS PUBLISHED** + +Read all about it on [v2.pi4j.com](https://v2.pi4j.com/). + +**TEXT BELOW TO BE MOVED TO NEW WEBSITE** + + Earlier versions of Pi4J were perhaps too ambitious in scope and that led to significant project bloat to the point that the project was becoming unsustainable. The goal moving forward is to limit scope to that of the raw I/O capabilities From 682b52aa1d284d17c5ec8be07f9206953d071265 Mon Sep 17 00:00:00 2001 From: Frank Delporte Date: Wed, 3 Jun 2020 22:30:34 +0200 Subject: [PATCH 2/2] Fix build errors --- .../java/com/pi4j/example/gpio/digital/DigitalInputExample.java | 2 +- .../digital/DigitalInputExampleUsingDependencyInjection.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pi4j-example/src/main/java/com/pi4j/example/gpio/digital/DigitalInputExample.java b/pi4j-example/src/main/java/com/pi4j/example/gpio/digital/DigitalInputExample.java index b2f2c90d3..cbdbaf76f 100644 --- a/pi4j-example/src/main/java/com/pi4j/example/gpio/digital/DigitalInputExample.java +++ b/pi4j-example/src/main/java/com/pi4j/example/gpio/digital/DigitalInputExample.java @@ -60,7 +60,7 @@ public DigitalInputExample() { */ public static void main(String[] args) throws Exception { // configure logging output - System.setProperty(org.slf4j.simple.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "INFO"); + System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "INFO"); // TODO :: REMOVE TEMPORARY PROPERTIES WHEN NATIVE PIGPIO LIB IS READY // this temporary property is used to tell diff --git a/pi4j-example/src/main/java/com/pi4j/example/gpio/digital/DigitalInputExampleUsingDependencyInjection.java b/pi4j-example/src/main/java/com/pi4j/example/gpio/digital/DigitalInputExampleUsingDependencyInjection.java index d679a46d9..a6e7d58bd 100644 --- a/pi4j-example/src/main/java/com/pi4j/example/gpio/digital/DigitalInputExampleUsingDependencyInjection.java +++ b/pi4j-example/src/main/java/com/pi4j/example/gpio/digital/DigitalInputExampleUsingDependencyInjection.java @@ -55,7 +55,7 @@ public class DigitalInputExampleUsingDependencyInjection { public static void main(String[] args) throws Exception { // configure logging output - System.setProperty(org.slf4j.simple.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "TRACE"); + System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "TRACE"); // TODO :: REMOVE TEMPORARY PROPERTIES WHEN NATIVE PIGPIO LIB IS READY // this temporary property is used to tell