Skip to content

Commit

Permalink
markdown linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tiloKo committed Sep 10, 2024
1 parent c9f1c5f commit 082bcf5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Please see our [guideline for AI-generated code contributions to SAP Open Source

## Development Guidelines

See our [Development Guidelines](DEVELOPMENT.md)
See our [Development Guidelines](DEVELOPMENT.md)
29 changes: 15 additions & 14 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ cd jenkins-library
git remote add upstream [email protected]:sap/jenkins-library.git
git remote set-url --push upstream no_push
```

### EditorConfig

To ensure a common file format, there is a `.editorConfig` file [in place](../.editorconfig). To respect this file, [check](http://editorconfig.org/#download) if your editor does support it natively or you need to download a plugin.
Expand Down Expand Up @@ -750,11 +751,11 @@ Code shall contain comments to explain the intention of the code when it is uncl

#### Use the return keyword

In Groovy it is optional to use the _return_ keyword. Use explicitly the _return_ keyword for better readability.
In Groovy it is optional to use the *return* keyword. Use explicitly the *return* keyword for better readability.

#### Use def

When using _def_ in Groovy, the type is Object. Using _def_ simplifies the code, for example imports are not needed, and therefore the development is faster.
When using *def* in Groovy, the type is Object. Using *def* simplifies the code, for example imports are not needed, and therefore the development is faster.

#### Do not use a visibility modifier for public classes and methods

Expand Down Expand Up @@ -790,11 +791,11 @@ Use named parameters for Jenkins Pipeline Steps:

e.g. `sh returnStdout: true, script: command`

#### Do not use _with()_ operator
#### Do not use *with()* operator

The _with_ operator is not yet supported by Jenkins, and it must not be used or encapsulated in a @NonCPS method.
The *with* operator is not yet supported by Jenkins, and it must not be used or encapsulated in a @NonCPS method.

#### Use _==_ operator
#### Use *==* operator

Use Groovy’s `==` instead of Java `equals()` to avoid NullPointerExceptions. To compare the references of objects, instead of `==`, you should use `a.is(b)` [[1]](http://groovy-lang.org/style-guide.html).

Expand Down Expand Up @@ -833,7 +834,7 @@ For a complete description of all available methods, please read the GDK API [[5

#### Use Groovy's switch

Groovy’s switch accepts any kind of type, thereby is more powerful. In this case, the use of _def_ instead of a type is necessary.
Groovy’s switch accepts any kind of type, thereby is more powerful. In this case, the use of *def* instead of a type is necessary.

#### Use alias for import

Expand All @@ -843,19 +844,19 @@ In Groovy, it is possible to assign an alias to imported packages. Use alias for

In Groovy a null, void, equal to zero, or empty object evaluates to false, and if not, evaluates to true. Instead of writing null and size checks e.g. `if (name != null && name.length > 0) {}`, use just the object `if (name) {}`.

#### Use _?._ operator
#### Use *?.* operator

Use the safe dereference operator _?._, to simplify the code for accessing objects and object members safely. Using this operator, the Groovy compiler checks null objects and null object members, and returns _null_ if the object or the object member is null and never throws a NullPointerException.
Use the safe dereference operator *?.*, to simplify the code for accessing objects and object members safely. Using this operator, the Groovy compiler checks null objects and null object members, and returns *null* if the object or the object member is null and never throws a NullPointerException.

#### Use _?:_ operator
#### Use *?:* operator

Use Elvis operator _?:_ to simplify default value validations.
Use Elvis operator *?:* to simplify default value validations.

#### Use _any_ keyword
#### Use *any* keyword

If the type of the exception thrown inside a try block is not important, catch any exception using the _any_ keyword.
If the type of the exception thrown inside a try block is not important, catch any exception using the *any* keyword.

#### Use _assert_
#### Use *assert*

To check parameters, return values, and more, use the assert statement.

Expand All @@ -869,4 +870,4 @@ To check parameters, return values, and more, use the assert statement.

[4] Jenkins Pipeline's syntax: [https://jenkins.io/doc/book/pipeline/syntax/](https://jenkins.io/doc/book/pipeline/syntax/)

[5] GDK: Groovy Development Kit: [http://groovy-lang.org/groovy-dev-kit.html](http://groovy-lang.org/groovy-dev-kit.html)
[5] GDK: Groovy Development Kit: [http://groovy-lang.org/groovy-dev-kit.html](http://groovy-lang.org/groovy-dev-kit.html)

0 comments on commit 082bcf5

Please sign in to comment.