From 082bcf505b0233bcfaa1528cfb6a4c048d456bc8 Mon Sep 17 00:00:00 2001 From: tiloKo <70266685+tiloKo@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:48:47 +0200 Subject: [PATCH] markdown linting --- CONTRIBUTING.md | 2 +- DEVELOPMENT.md | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ffa370e100..b1b80deca1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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) \ No newline at end of file +See our [Development Guidelines](DEVELOPMENT.md) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index c70a79ead3..9d826844ce 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -61,6 +61,7 @@ cd jenkins-library git remote add upstream git@github.com: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. @@ -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 @@ -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). @@ -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 @@ -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. @@ -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) \ No newline at end of file +[5] GDK: Groovy Development Kit: [http://groovy-lang.org/groovy-dev-kit.html](http://groovy-lang.org/groovy-dev-kit.html)