Skip to content

Commit

Permalink
Fix linter errors. 🔧(openhab#1437)
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Luckenbach <[email protected]>
  • Loading branch information
Confectrician authored Jan 10, 2021
1 parent c1903fe commit a326030
Show file tree
Hide file tree
Showing 25 changed files with 156 additions and 148 deletions.
25 changes: 12 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Contribution Guidelines

### Pull requests are always welcome
## Pull requests are always welcome

We are always thrilled to receive pull requests, and do our best to
process them as fast as possible. Not sure if that typo is worth a pull
request? Do it! We will appreciate it.

### Conventions
## Conventions

Fork the repo and make changes on your fork in a feature branch.

Expand All @@ -28,15 +28,15 @@ comment.
Commits that fix or close an issue should include a reference like `Closes #XXX`
or `Fixes #XXX`, which will automatically close the issue when merged.

### Sign your work
## Sign your work

The sign-off is a simple line at the end of the explanation for the
patch, which certifies that you wrote it or otherwise have the right to
pass it on as an open-source patch. The rules are pretty simple: if you
can certify the below (from
[developercertificate.org](https://developercertificate.org/)):

```
```text
Developer Certificate of Origin
Version 1.1
Expand Down Expand Up @@ -77,42 +77,41 @@ By making a contribution to this project, I certify that:

then you just add a line to every git commit message:

Signed-off-by: Joe Smith <[email protected]>
`Signed-off-by: Joe Smith <[email protected]>`

using your real name (sorry, no pseudonyms or anonymous contributions.) and an
e-mail address under which you can be reached (sorry, no github noreply e-mail
addresses (such as [email protected]) or other non-reachable
addresses are allowed).

#### Small patch exception
### Small patch exception

There are several exceptions to the signing requirement. Currently these are:

* Your patch fixes spelling or grammar errors.
* Your patch is a single line change to documentation.
- Your patch fixes spelling or grammar errors.
- Your patch is a single line change to documentation.

## Community Guidelines

We want to keep the openHAB community awesome, growing and collaborative. We
need your help to keep it that way. To help with this we've come up with some
general guidelines for the community as a whole:

* Be nice: Be courteous, respectful and polite to fellow community members: no
- Be nice: Be courteous, respectful and polite to fellow community members: no
regional, racial, gender, or other abuse will be tolerated. We like nice people
way better than mean ones!

* Encourage diversity and participation: Make everyone in our community
- Encourage diversity and participation: Make everyone in our community
feel welcome, regardless of their background and the extent of their
contributions, and do everything possible to encourage participation in
our community.

* Keep it legal: Basically, don't get us in trouble. Share only content that
- Keep it legal: Basically, don't get us in trouble. Share only content that
you own, do not share private or sensitive information, and don't break the
law.

* Stay on topic: Make sure that you are posting to the correct channel
- Stay on topic: Make sure that you are posting to the correct channel
and avoid off-topic discussions. Remember when you update an issue or
respond to an email you are potentially sending to a large number of
people. Please consider this before you update. Also remember that
nobody likes spam.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ We will read about them later.
Correct, this is done in the original repository of the add-on.
You may want to know how to find the right file in all of those repos?
This is fairly easy:
on most of the documentation pages on https://openhab.org/,
on most of the documentation pages on <https://openhab.org/>,
you will find the following link at the bottom, which will point you directly to the file you want to improve.

![Contribution link to a specific page](./images/contribution_link.png)
Expand Down Expand Up @@ -96,4 +96,4 @@ In short, the following has to be considered:
- Versions like "2.1.0" are marked by git tags.
- Based on tags branches like "2.1-patch" are created, to include later discovered changes (like fixed links).

When a version is tagged (or updated), a static version of the website has to be generated and copied into the correct sub-folder, this is currently a manual operation described succinctly here: https://github.com/openhab/website/issues/72
When a version is tagged (or updated), a static version of the website has to be generated and copied into the correct sub-folder, this is currently a manual operation described succinctly here: <https://github.com/openhab/website/issues/72>
4 changes: 2 additions & 2 deletions addons/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ One can configure whether specific log entries are logged out and where they get

You have different options to execute a command through an action.

- `executeCommandLine(String commandLine)`: Executes a command on the command line without waiting for the command to complete
For example you could run `executeCommandLine("path/to/my/script.sh")` which then would be executed and the rule would continue processing.
- `executeCommandLine(String commandLine)`: Executes a command on the command line without waiting for the command to complete.
For example you could run `executeCommandLine("path/to/my/script.sh")` which then would be executed and the rule would continue processing.

- `executeCommandLine(Duration.ofSeconds(timeout), String commandLine)`: Executes a command on the command and waits `timeout` seconds for the command to complete, returning the output from the command as a String
For example you could run `var ScriptResponse = executeCommandLine(Duration.ofSeconds(60), "path/to/my/script.sh");` would get executed and wait 1 minute for the output to be responded back and write it into the `ScriptResponse` variable.
Expand Down
2 changes: 1 addition & 1 deletion administration/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The method used to access the console depends on how openHAB was started.

- When started in interactive mode using the provided command line scripts (e.g. `start.sh` or `start.bat`), openHAB naturally transitions directly to the console prompt.
- When started as a service (i.e. when openHAB is running as a background process), access to the console is given by running the `$OPENHAB_RUNTIME/bin/client` (`client.bat` for Windows) script or by [connecting via SSH](#connecting-via-ssh).
Linux package based installations can also use the command `openhab-cli console`.
Linux package based installations can also use the command `openhab-cli console`.

The default username/password is **openhab:habopen**, so enter `habopen` at the password prompt.

Expand Down
7 changes: 4 additions & 3 deletions configuration/habpanel.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,10 @@ Upon clicking on a custom widget definition, the widget designer opens. It conta
- **Code:** This tab is an editor for the template's code. You can use the Ctrl-S (or Cmd-S) keyboard shortcut to save the widget while editing the code;

- **Settings:** This tab hosts the widget's general settings and configuration settings structure to be defined.
Click on the **Add setting** to add a new configuration setting. Each configuration setting must have a type, a technical ID, and other optional attributes. Each type of setting determines the UI element presented in the dashboard designer when configuring instances of the custom widget.
Use the arrow buttons to move configuration settings up or down, and the trash bin icon to remove them.
When instantiated, the value of configuration settings are set in the template's scope as `config.<setting_id>` (except those of type Icon which define an additional value, the iconset name, as `config.<setting_id>_iconset`);
Click on the **Add setting** to add a new configuration setting. Each configuration setting must have a type, a technical ID, and other optional attributes.
Each type of setting determines the UI element presented in the dashboard designer when configuring instances of the custom widget.
Use the arrow buttons to move configuration settings up or down, and the trash bin icon to remove them.
When instantiated, the value of configuration settings are set in the template's scope as `config.<setting_id>` (except those of type Icon which define an additional value, the iconset name, as `config.<setting_id>_iconset`);

- **Preview:** Upon switching to this tab, a test instance of the widget is rendered in an otherwise blank testbed dashboard. Use the sliders to resize the widget in order to preview it at different sizes. If it defines configuration settings, they must likely be set for this preview using the gears icon: this will bring up the widget instance's configuration dialog as it would appear in the dashboard designer.

Expand Down
45 changes: 23 additions & 22 deletions configuration/migration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description: Description of Beaking Changes and needed steps for a proper Migrat
There are different approaches to get your openHAB 2 Environment upgraded to openHAB 3.
You could start with a fresh install and migrate your environment step-by-step or you can upgrade your running environment and change your configuration where needed.

Since this is a major version release you have to pay attention to some `Breaking Changes` that may affect your environment too.
You can find a general note on the `Breaking Changes` here:
https://github.com/openhab/openhab-distro/wiki/Breaking-Changes-in-openHAB-3
Since this is a major version release you have to pay attention to some **Breaking Changes** that may affect your environment too.
You can find a general note on the **Breaking Changes** here:
<https://github.com/openhab/openhab-distro/wiki/Breaking-Changes-in-openHAB-3>

Please read them carefully and check if you are affected by some of the changes, like the changes to some rules namespaces and the handling of time functions.

Expand All @@ -25,8 +25,8 @@ Please be aware of possible changes needed for your specific environment in case
If you are working with an [openHABian](https://www.openhab.org/docs/installation/openhabian.html) setup, the upgrade is quite easy. Regardless of if you are currently using the openHAB 2.5 stable release or one of the latest 3.0.0 SNAPSHOT or milestone builds, switching to openHAB 3.0.0 stable is done in just a few steps:

1. Connect to the SSH command line and execute: `sudo openhabian-config`
2. When being asked, answer that you want to update.
3. Select the menu entry"03 - Install openHAB" option.
1. When being asked, answer that you want to update.
1. Select the menu entry"03 - Install openHAB" option.

### Package-based Installations

Expand All @@ -46,13 +46,13 @@ You must also be on the relevant repository for openHAB, this hasn't changed for

For DEB based installers (apt), your `.list` file should contain the line:

```
```shell
deb https://dl.bintray.com/openhab/apt-repo2 stable main
```

For RPM based installers (yum), your `.repo` file should contain:

```
```shell
[openHAB-Stable]
name=openHAB Stable
baseurl=https://dl.bintray.com/openhab/rpm-repo2/stable
Expand All @@ -71,7 +71,7 @@ With `openhab2` still installed:

##### APT (Debian / Ubuntu and derivatives)

```
```shell
sudo apt update
sudo apt install openhab
```
Expand All @@ -80,14 +80,14 @@ The system will ask you if you want to remove `openhab2` as part of this, and yo

You can get rid of openHAB2 leftover configuration files by using the `sudo apt purge openhab2` command, but this also gets rid of the `openhab` user, to fix this issue you should follow this with:

```
```shell
sudo apt install --reinstall openhab
sudo openhab-cli reset-ownership
```

##### DNF (RedHat, CentOS, Fedora, etc.)

```
```shell
sudo dnf --allowerasing install openhab
```

Expand All @@ -96,7 +96,8 @@ DNF does not replace configuration files for you by default, have a look at the
##### YUM (Older RedHat, CentOS, Fedora, etc.)

The equivalent command should be:
```

```shell
sudo yum swap openhab2 openhab
```

Expand All @@ -114,20 +115,20 @@ After a successful install, you can use commands like `sudo systemctl start open

##### APT (Debian / Ubuntu and derivatives)

```sh
```shell
sudo apt purge openhab2
sudo apt update
sudo apt install openhab
```

##### YUM or DNF (RedHat, CentOS, Fedora, etc)

```sh
```shell
sudo dnf remove openhab2
sudo dnf install openhab
```

Replace "dnf" with "yum" for older Red Hat based OSes.
<a name="manual-installations">

### Manual Installations

Expand All @@ -138,20 +139,20 @@ Official update scripts are available that let you update your 2.x installation
#### Linux/MacOS

1. Change to your openHAB root directory (e.g. `cd /opt/openhab`)
2. Create a backup by calling `sudo ./runtime/bin/backup`.
2. Run the update command:
1. Create a backup by calling `sudo ./runtime/bin/backup`.
1. Run the update command:

```
```shell
sudo ./runtime/bin/update 3.0.0
```

#### Windows

1. Make a backup of your openHAB installation folder.
2. Run PowerShell as an administrator and change to your openHAB root directory (e.g. `cd C:\openHAB`)
3. Run the update command:
1. Run PowerShell as an administrator and change to your openHAB root directory (e.g. `cd C:\openHAB`)
1. Run the update command:

```
. .\runtime\bin\update.ps1
Update-openHAB -OHVersion 3.0.0
```shell
. .\runtime\bin\update.ps1
Update-openHAB -OHVersion 3.0.0
```
5 changes: 3 additions & 2 deletions configuration/persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ where `<itemlist>` is a comma-separated list consisting of one or more of the fo

- `*` - this line should apply to all items in the system
- `<itemName>` a single Item identified by its name. This Item can be a group Item. But note that only the group value will be persisted. The value of the individual group members will not be persisted using this option.
- `<groupName>*` - all members of this group will be persisted, but not the group itself. If no strategies are provided, the default strategies that are declared in the first section are applied. Optionally, an alias may be provided if the persistence service requires special names (e.g. a table to be used in a database, a feed id for an IoT service, etc.)
Note that * is NOT a wildcard match character in this context.
- `<groupName>*` - all members of this group will be persisted, but not the group itself. If no strategies are provided, the default strategies that are declared in the first section are applied.
Optionally, an alias may be provided if the persistence service requires special names (e.g. a table to be used in a database, a feed id for an IoT service, etc.)
Note that `*` is NOT a wildcard match character in this context.

The example `Items` section below takes advantage of a `default` entry in the `Strategies` section.
Assume the `Strategies` section contains the line:
Expand Down
10 changes: 5 additions & 5 deletions configuration/sitemaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ This provides the flexibility to present Items in the way desired in your home a
- `icon` chooses the name of the icon file to show next to the element, [more details](items.html#icons).

- When an [Item]({{base}}/configuration/items.html) is defined, you have the opportunity to assign a label and/or an icon at that point.
If no label or icon are specified in the Sitemap, then the label and/or icon you assigned to the Item will be displayed.
Setting a value for `label` or `icon` of a Sitemap element will override the values defined for the linked Item.
If no label or icon are specified in the Sitemap, then the label and/or icon you assigned to the Item will be displayed.
Setting a value for `label` or `icon` of a Sitemap element will override the values defined for the linked Item.

It has to be considered that if the label defined in a Channel or an Item contains text and state, these representations have to be overwritten separately in the Sitemap.
In the following example a Item which has a label and state defined is overwritten.
Expand Down Expand Up @@ -446,13 +446,13 @@ Adds a time-series chart object for the display of logged data.
- `refresh` defines the refresh period of the Image (in milliseconds).

- `service` sets the persistence service to use.
If no service is specified, openHAB will use the first queryable persistence service it finds.
Therefore, for an installation with only a single persistence service, this is not required.
If no service is specified, openHAB will use the first queryable persistence service it finds.
Therefore, for an installation with only a single persistence service, this is not required.

- `period` is the scale of the time axis. Valid values are `h, 4h, 8h, 12h, D, 2D, 3D, W, 2W, M, 2M, 4M or Y`.

- `begin` / `end` sets the beginning and end of the time axis.
Valid values are in the format: "yyyyMMddHHmm" (yyyy = year, MM = month, dd = day, HH = hour (0-23), mm = minutes).
Valid values are in the format: `yyyyMMddHHmm` (`yyyy` = year, `MM` = month, `dd` = day, `HH` = hour (0-23), `mm` = minutes).

- `legend` is used to show or to hide the chart legend.
Valid values are `true` (always show the legend) and `false` (never show the legend).
Expand Down
8 changes: 4 additions & 4 deletions developers/bindings/binding-xml.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: developersguide
title: Binding Descriptions
---

## Binding Definitions
# Binding Definitions

Every binding has to provide meta information such as binding id or name.

Expand All @@ -16,7 +16,7 @@ The full Java API for binding definitions can be found in the Java package `org.

For the declarative way, you add your binding information in form of a `binding.xml` file to the bundle's folder `/src/main/resources/OH-INF/binding/binding.xml`.

### XML Structure for Binding Definitions
## XML Structure for Binding Definitions

```xml
<?xml version="1.0" encoding="UTF-8"?>
Expand Down Expand Up @@ -57,9 +57,9 @@ The full XML schema for binding definitions is specified in the [Binding XSD](ht
- The attribute `uri` in the section `config-description` is optional, it *should not* be specified in binding definition files because it's an embedded configuration. If the `uri` is *not* specified, the configuration description is registered as `binding:bindingID`, otherwise the given `uri` is used.
- If a configuration description is already specified somewhere else and the binding wants to (re-)use it, a `config-description-ref` should be used instead.
- Normally the service id must not be defined, because it is implicitly set to "binding.&lt;binding.id&gt;".
A binding can register an OSGi service which implements the ManagedService interface and define the service.pid as e.g."binding.hue" to receive the configuration.
A binding can register an OSGi service which implements the ManagedService interface and define the service.pid as e.g."binding.hue" to receive the configuration.

### Example
## Example

The following code gives an example for a binding definition.

Expand Down
3 changes: 1 addition & 2 deletions developers/bindings/config-xml.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The description can include limited HTML to enhance the display of this informat

The following HTML tags are allowed -: ```<b>, <br>, <em>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <i>, <p>, <small>, <strong>, <sub>, <sup>, <ul>, <ol>, <li>```.
These must be inside the XML escape sequence - eg.
```<description><![CDATA[ HTML marked up text here ]]></description>```.
`<description><![CDATA[ HTML marked up text here ]]></description>`.

## XML Structure for Configuration Descriptions

Expand Down Expand Up @@ -150,7 +150,6 @@ The above filter is evaluated as follows:

```text
(type=Switch OR type=Dimmer) AND (tag=Light OR tag=Heating)
```

Similarly, the <strong>Channel</strong> context can contain criteria to filter channels based on <strong>kind</strong> field.
Expand Down
Loading

0 comments on commit a326030

Please sign in to comment.