From 4aa31d5d914485cde117c4183016430ff8401ce4 Mon Sep 17 00:00:00 2001 From: egon-okerman-sonarsource Date: Thu, 3 Oct 2024 14:34:26 +0000 Subject: [PATCH 1/2] Add ansible to rule S4830 --- rules/S4830/ansible/metadata.json | 2 ++ rules/S4830/ansible/rule.adoc | 44 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 rules/S4830/ansible/metadata.json create mode 100644 rules/S4830/ansible/rule.adoc diff --git a/rules/S4830/ansible/metadata.json b/rules/S4830/ansible/metadata.json new file mode 100644 index 00000000000..7a73a41bfdf --- /dev/null +++ b/rules/S4830/ansible/metadata.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/rules/S4830/ansible/rule.adoc b/rules/S4830/ansible/rule.adoc new file mode 100644 index 00000000000..912ec60d258 --- /dev/null +++ b/rules/S4830/ansible/rule.adoc @@ -0,0 +1,44 @@ +FIXME: add a description + +// If you want to factorize the description uncomment the following line and create the file. +//include::../description.adoc[] + +== Why is this an issue? + +FIXME: remove the unused optional headers (that are commented out) + +//=== What is the potential impact? + +== How to fix it +//== How to fix it in FRAMEWORK NAME + +=== Code examples + +==== Noncompliant code example + +[source,yaml,diff-id=1,diff-type=noncompliant] +---- +FIXME +---- + +==== Compliant solution + +[source,yaml,diff-id=1,diff-type=compliant] +---- +FIXME +---- + +//=== How does this work? + +//=== Pitfalls + +//=== Going the extra mile + + +//== Resources +//=== Documentation +//=== Articles & blog posts +//=== Conference presentations +//=== Standards +//=== External coding guidelines +//=== Benchmarks From 900924aca297449207f33efa29aa978a68550683 Mon Sep 17 00:00:00 2001 From: Egon Okerman Date: Thu, 3 Oct 2024 17:30:56 +0200 Subject: [PATCH 2/2] Add Ansible section --- rules/S4830/ansible/metadata.json | 3 +- rules/S4830/ansible/rule.adoc | 60 +++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 21 deletions(-) diff --git a/rules/S4830/ansible/metadata.json b/rules/S4830/ansible/metadata.json index 7a73a41bfdf..9e26dfeeb6e 100644 --- a/rules/S4830/ansible/metadata.json +++ b/rules/S4830/ansible/metadata.json @@ -1,2 +1 @@ -{ -} \ No newline at end of file +{} \ No newline at end of file diff --git a/rules/S4830/ansible/rule.adoc b/rules/S4830/ansible/rule.adoc index 912ec60d258..2e2107790c4 100644 --- a/rules/S4830/ansible/rule.adoc +++ b/rules/S4830/ansible/rule.adoc @@ -1,44 +1,66 @@ -FIXME: add a description - -// If you want to factorize the description uncomment the following line and create the file. -//include::../description.adoc[] +include::../summary.adoc[] == Why is this an issue? -FIXME: remove the unused optional headers (that are commented out) +include::../rationale.adoc[] -//=== What is the potential impact? +include::../impact.adoc[] == How to fix it -//== How to fix it in FRAMEWORK NAME === Code examples +include::../common/fix/code-rationale.adoc[] + ==== Noncompliant code example [source,yaml,diff-id=1,diff-type=noncompliant] ---- -FIXME +- name: Example playbook + hosts: server + tasks: + - name: Retrieve a web page + ansible.builtin.uri: + url: https://www.example.com + validate_certs: false # Noncompliant + return_content: true ---- ==== Compliant solution [source,yaml,diff-id=1,diff-type=compliant] ---- -FIXME +- name: Example playbook + hosts: server + tasks: + - name: Retrieve a web page + ansible.builtin.uri: + url: https://www.example.com + return_content: true ---- -//=== How does this work? +=== How does this work? + +include::../common/fix/validation.adoc[] + + +== Resources + +include::../common/resources/standards.adoc[] + +ifdef::env-github,rspecator-view[] + +''' +== Implementation Specification +(visible only on this page) + +include::../message.adoc[] -//=== Pitfalls +''' +== Comments And Links +(visible only on this page) -//=== Going the extra mile +include::../comments-and-links.adoc[] +endif::env-github,rspecator-view[] -//== Resources -//=== Documentation -//=== Articles & blog posts -//=== Conference presentations -//=== Standards -//=== External coding guidelines -//=== Benchmarks