From 349708ef0f272ce5db02b77163c3d2f2006f66be Mon Sep 17 00:00:00 2001 From: Gregory Paidis <115458417+gregory-paidis-sonarsource@users.noreply.github.com> Date: Wed, 25 Jan 2023 16:01:05 +0100 Subject: [PATCH] Modify rule S4663: Add support for C# and VB.NET (#1513) * Modify metadata for csharp * Modify metadata for vbnet * Fix some references * Apply PR Review fixes * Apply PR Review changes --- rules/S4663/csharp/description.adoc | 1 + rules/S4663/csharp/metadata.json | 2 +- rules/S4663/csharp/noncompliant.adoc | 14 ++++++++++++++ rules/S4663/csharp/rule.adoc | 5 ++++- rules/S4663/vbnet/description.adoc | 1 + rules/S4663/vbnet/metadata.json | 2 +- rules/S4663/vbnet/noncompliant.adoc | 8 ++++++++ rules/S4663/vbnet/rule.adoc | 5 ++++- 8 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 rules/S4663/csharp/description.adoc create mode 100644 rules/S4663/csharp/noncompliant.adoc create mode 100644 rules/S4663/vbnet/description.adoc create mode 100644 rules/S4663/vbnet/noncompliant.adoc diff --git a/rules/S4663/csharp/description.adoc b/rules/S4663/csharp/description.adoc new file mode 100644 index 00000000000..5306cf4c6dc --- /dev/null +++ b/rules/S4663/csharp/description.adoc @@ -0,0 +1 @@ +An empty comment is likely to be a mistake and doesn't help to improve the readability of the code. For these reasons, it should be removed. diff --git a/rules/S4663/csharp/metadata.json b/rules/S4663/csharp/metadata.json index 17971333806..568184229d1 100644 --- a/rules/S4663/csharp/metadata.json +++ b/rules/S4663/csharp/metadata.json @@ -1,3 +1,3 @@ { - + "title": "Comments should not be empty" } diff --git a/rules/S4663/csharp/noncompliant.adoc b/rules/S4663/csharp/noncompliant.adoc new file mode 100644 index 00000000000..e2a6740e594 --- /dev/null +++ b/rules/S4663/csharp/noncompliant.adoc @@ -0,0 +1,14 @@ +== Noncompliant Code Example + +[source,text] +---- +// + +/* +*/ + +/// + +/** +*/ +---- diff --git a/rules/S4663/csharp/rule.adoc b/rules/S4663/csharp/rule.adoc index 79d6542388c..32b432746fd 100644 --- a/rules/S4663/csharp/rule.adoc +++ b/rules/S4663/csharp/rule.adoc @@ -1,4 +1,7 @@ -include::../rule.adoc[] +include::description.adoc[] + +include::noncompliant.adoc[] + ifdef::env-github,rspecator-view[] ''' diff --git a/rules/S4663/vbnet/description.adoc b/rules/S4663/vbnet/description.adoc new file mode 100644 index 00000000000..5306cf4c6dc --- /dev/null +++ b/rules/S4663/vbnet/description.adoc @@ -0,0 +1 @@ +An empty comment is likely to be a mistake and doesn't help to improve the readability of the code. For these reasons, it should be removed. diff --git a/rules/S4663/vbnet/metadata.json b/rules/S4663/vbnet/metadata.json index 17971333806..568184229d1 100644 --- a/rules/S4663/vbnet/metadata.json +++ b/rules/S4663/vbnet/metadata.json @@ -1,3 +1,3 @@ { - + "title": "Comments should not be empty" } diff --git a/rules/S4663/vbnet/noncompliant.adoc b/rules/S4663/vbnet/noncompliant.adoc new file mode 100644 index 00000000000..092053e3bcb --- /dev/null +++ b/rules/S4663/vbnet/noncompliant.adoc @@ -0,0 +1,8 @@ +== Noncompliant Code Example + +[source,text] +---- +' + +''' +---- diff --git a/rules/S4663/vbnet/rule.adoc b/rules/S4663/vbnet/rule.adoc index 79d6542388c..32b432746fd 100644 --- a/rules/S4663/vbnet/rule.adoc +++ b/rules/S4663/vbnet/rule.adoc @@ -1,4 +1,7 @@ -include::../rule.adoc[] +include::description.adoc[] + +include::noncompliant.adoc[] + ifdef::env-github,rspecator-view[] '''