parent
d7138f5ef4
commit
cd424756a0
105
ci/asciidoc_validation/validate_environment.py
Normal file
105
ci/asciidoc_validation/validate_environment.py
Normal file
@ -0,0 +1,105 @@
|
||||
# Validate the asciidoc environment directives in the given file(s).
|
||||
# Errors are printed to the standard output stream.
|
||||
#
|
||||
# "ifdef" commands has to start the line without any leading spaces,
|
||||
# as per asciidoc format.
|
||||
#
|
||||
# Only one form is allowed:
|
||||
# ifdef::env-github,rspecator-view[]
|
||||
#
|
||||
# The closing command is:
|
||||
# endif::env-github,rspecator-view[]
|
||||
#
|
||||
# It must be in the same file.
|
||||
# Only one such environment is allowed per file.
|
||||
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
|
||||
VALID_IFDEF = "ifdef::env-github,rspecator-view[]"
|
||||
VALID_ENDIF = "endif::env-github,rspecator-view[]"
|
||||
|
||||
|
||||
class Checker:
|
||||
def __init__(self, file: Path):
|
||||
assert file.exists()
|
||||
assert file.is_file()
|
||||
|
||||
self._file = file
|
||||
self._is_env_open = False
|
||||
self._has_env = False
|
||||
self._is_valid = True
|
||||
|
||||
def process(self) -> bool:
|
||||
content = self._file.read_text(encoding="utf-8")
|
||||
lines = content.splitlines(keepends=False)
|
||||
for line_index, line in enumerate(lines):
|
||||
line_number = line_index + 1
|
||||
if line.startswith("ifdef::"):
|
||||
self._process_open(line_number, line)
|
||||
if line.startswith("endif::"):
|
||||
self._process_close(line_number, line)
|
||||
|
||||
if self._is_env_open:
|
||||
self._on_error(len(lines), "The ifdef command is not closed.")
|
||||
|
||||
return self._is_valid
|
||||
|
||||
def _process_open(self, line_number: int, line: str):
|
||||
if self._has_env:
|
||||
self._on_error(line_number, "Only one ifdef command is allowed per file.")
|
||||
|
||||
if self._is_env_open:
|
||||
self._on_error(line_number, "The previous ifdef command was not closed.")
|
||||
|
||||
self._has_env = True
|
||||
self._is_env_open = True
|
||||
|
||||
# IDEs should be configured to properly display the description,
|
||||
# not the other way around.
|
||||
# "env-vscode" was used in the passed. Instead, user should be able to
|
||||
# toggle the rspecator view based on their needs. Help these users migrate.
|
||||
if "vscode" in line:
|
||||
self._on_error(
|
||||
line_number,
|
||||
"Configure VS Code to display rspecator-view by setting the asciidoctor attribute.",
|
||||
)
|
||||
|
||||
if line != VALID_IFDEF:
|
||||
self._on_error(
|
||||
line_number,
|
||||
f'Incorrect asciidoc environment. "{VALID_IFDEF}" should be used instead.',
|
||||
)
|
||||
|
||||
def _process_close(self, line_number: int, line: str):
|
||||
if not self._is_env_open:
|
||||
self._on_error(line_number, "Unexpected endif command.")
|
||||
|
||||
self._is_env_open = False
|
||||
|
||||
if line != VALID_ENDIF:
|
||||
self._on_error(
|
||||
line_number,
|
||||
f'Incorrect endif command. "{VALID_ENDIF}" should be used instead.',
|
||||
)
|
||||
|
||||
def _on_error(self, line_number: int, message: str):
|
||||
print(f"{self._file}:{line_number} {message}")
|
||||
self._is_valid = False
|
||||
|
||||
|
||||
def main():
|
||||
files = sys.argv[1:]
|
||||
if not files:
|
||||
sys.exit("Missing input files")
|
||||
|
||||
valid = True
|
||||
for file in files:
|
||||
if not Checker(Path(file)).process():
|
||||
valid = False
|
||||
if not valid:
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -43,6 +43,7 @@ fi
|
||||
# * Only valid languages can be used as subdirectories in rule directories,
|
||||
# with the exception of ALLOWED_RULE_SUB_FOLDERS.
|
||||
# * Asciidoc files are free or errors and warnings.
|
||||
# * ifdef/endif are used appropriatedly.
|
||||
#
|
||||
# [properties validated always on all rules]
|
||||
# * Rule descriptions can include other asciidoc files from the same rule
|
||||
@ -85,6 +86,17 @@ do
|
||||
fi
|
||||
rm -f stuck
|
||||
|
||||
# Validate modified files' ifdef/endif commands.
|
||||
find "${dir}" -name '*.adoc' \
|
||||
-exec python3 "./ci/asciidoc_validation/validate_environment.py" '{}' '+' \
|
||||
>validate_env_commands 2>&1
|
||||
if [ -s validate_env_commands ]; then
|
||||
echo "ERROR: Some ifdef/endif commands are misused."
|
||||
cat validate_env_commands
|
||||
exit_code=1
|
||||
fi
|
||||
rm -f validate_env_commands
|
||||
|
||||
for language in "${dir}"/*/
|
||||
do
|
||||
language=${language%*/}
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -21,4 +21,4 @@ The 'throw' statement.
|
||||
=== on 1 Mar 2018, 17:03:27 Valeri Hristov wrote:
|
||||
Throwing in IDisposable.Dispose is covered in RSPEC-3877
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
@ -34,4 +34,6 @@ ifdef::env-github,rspecator-view[]
|
||||
|
||||
include::../message.adoc[]
|
||||
|
||||
'''
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -49,4 +49,4 @@ ifdef::env-github,rspecator-view[]
|
||||
|
||||
Use ".Any()" to test whether this "IEnumerable(Of XXX)" is empty or not.
|
||||
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -90,4 +90,6 @@ include::../message.adoc[]
|
||||
== Comments And Links
|
||||
(visible only on this page)
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -66,4 +66,6 @@ include::../message.adoc[]
|
||||
== Comments And Links
|
||||
(visible only on this page)
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -52,7 +52,7 @@ class MyClass
|
||||
* https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2[Dictionary<TKey,TValue> Class]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -74,4 +74,4 @@ The [class|struct] name.
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -16,4 +16,4 @@ include::parameters.adoc[]
|
||||
|
||||
include::comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -43,7 +43,7 @@ public class Choice {
|
||||
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs1717[Compiler Warning (level 3) CS1717]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -57,4 +57,4 @@ include::../message.adoc[]
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -17,4 +17,4 @@ include::highlighting.adoc[]
|
||||
|
||||
include::comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
@ -52,7 +52,7 @@ else if (param == 3)
|
||||
* https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements#the-if-statement[The if statement]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -76,4 +76,4 @@ include::../highlighting.adoc[]
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -41,7 +41,7 @@ End If
|
||||
|
||||
* https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/if-then-else-statement[If...Then...Else Statement]
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -59,4 +59,4 @@ include::../highlighting.adoc[]
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -28,4 +28,4 @@ include::../message.adoc[]
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
gndif::env-github,rspecator-view[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -31,4 +31,4 @@ include::../message.adoc[]
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
gndif::env-github,rspecator-view[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -30,4 +30,4 @@ include::../message.adoc[]
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
gndif::env-github,rspecator-view[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -32,4 +32,4 @@ include::../message.adoc[]
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
gndif::env-github,rspecator-view[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -18,4 +18,4 @@ Remove this useless shift (multiple of 32/64).
|
||||
|
||||
include::comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -173,7 +173,7 @@ int Pow(int num, int exponent)
|
||||
|
||||
* Edsger Dijkstra - https://www.cs.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD215.html[A Case against the GO TO Statement]
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -189,5 +189,5 @@ Add a way to break out of this \[[method|property|property accessor]'s recursion
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -12,4 +12,4 @@ include::message.adoc[]
|
||||
|
||||
include::comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -19,4 +19,4 @@ In fact, it's not an infinite loop because of integer overflow. On my computer,
|
||||
In JavaScript, moving the counter in the wrong direction causes an infinite loop because there is no integer type. All numbers are 64 bit floating point numbers.
|
||||
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -24,4 +24,4 @@ To me the 2 title versions are six-of-one-half-dozen-of-the-other. But given tha
|
||||
=== on 2 Dec 2014, 15:02:37 Pierre-Yves Nicolas wrote:
|
||||
No, I don't care much.
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -14,4 +14,4 @@ include::./highlighting.adoc[]
|
||||
|
||||
include::./comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -28,4 +28,4 @@ Double-check my edits please [~tamas.vajk]
|
||||
=== on 6 Jul 2015, 09:33:41 Tamas Vajk wrote:
|
||||
\[~ann.campbell.2] Looks good.
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -41,4 +41,4 @@ ifdef::env-github,rspecator-view[]
|
||||
Use "!=" instead.
|
||||
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -12,4 +12,4 @@ include::message.adoc[]
|
||||
|
||||
include::comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
@ -43,7 +43,7 @@ if (!double.IsNaN(a))
|
||||
----
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -60,4 +60,4 @@ Use [double|float].IsNaN() instead.
|
||||
|
||||
include::../comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -85,7 +85,7 @@ class PointManager<T1, T2>
|
||||
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct[Structure types (C# reference)]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -118,4 +118,4 @@ Looks good, I adjusted some wording in the first sentence of the description
|
||||
=== on 22 May 2015, 12:10:14 Ann Campbell wrote:
|
||||
Thanks [~tamas.vajk]. Looks good
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -83,7 +83,7 @@ static class MyClass
|
||||
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct[Structure types (C# reference)]
|
||||
* S3898 - Value types should implement "IEquatable<T>"
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -103,4 +103,4 @@ Use a different kind of comparison for these value types.
|
||||
=== on 8 Jun 2015, 09:32:21 Tamas Vajk wrote:
|
||||
LGTM, I've changed the `object` to `Object` just to conform to the title, but there is no difference, because `object` is just an alias for `System.Object`
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -98,7 +98,7 @@ public void Method()
|
||||
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/api/system.eventhandler[`EventHandler` Delegate]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -134,4 +134,4 @@ A method with `async` keyword returning a `Task` is like a non `async` method wi
|
||||
=== on 1 Jul 2015, 11:59:39 Ann Campbell wrote:
|
||||
Okay, thanks [~tamas.vajk]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -27,4 +27,4 @@ updated. See what you think [~tamas.vajk]
|
||||
=== on 20 Jul 2015, 11:44:56 Tamas Vajk wrote:
|
||||
\[~ann.campbell.2] Looks good.
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -52,7 +52,7 @@ void TraceMessage(string message = null,
|
||||
* https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callerargumentexpressionattribute[CallerArgumentExpressionAttribute Class]
|
||||
* https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#optional-arguments[Named and Optional Arguments]
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -76,4 +76,4 @@ And also modified the last sentence. It is possible to not specify all parameter
|
||||
=== on 18 Nov 2015, 19:55:28 Ann Campbell wrote:
|
||||
Okay, thanks [~tamas.vajk]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -23,4 +23,4 @@ class name
|
||||
done [~tamas.vajk]
|
||||
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -14,4 +14,4 @@ include::highlighting.adoc[]
|
||||
|
||||
include::comments-and-links.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
@ -32,7 +32,7 @@ interface IMyService
|
||||
|
||||
include::../resources.adoc[]
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -42,4 +42,4 @@ include::../message.adoc[]
|
||||
|
||||
include::../highlighting.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -30,7 +30,7 @@ End Interface
|
||||
|
||||
include::../resources.adoc[]
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -40,4 +40,4 @@ include::../message.adoc[]
|
||||
|
||||
include::../highlighting.adoc[]
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -45,7 +45,7 @@ void DoChecks<T>(Nullable<T> value) where T : struct
|
||||
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/api/system.nullreferenceexception[NullReferenceException Class]
|
||||
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -103,4 +103,4 @@ ____
|
||||
|
||||
But if C#ers will understand, I'm good with it.
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -12,4 +12,4 @@ Provide an 'AssemblyVersion' attribute for assembly 'xxx'.
|
||||
|
||||
Assembly declaration
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -191,7 +191,7 @@ public class UnsealedFoo : Foo
|
||||
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.iserializable.getobjectdata[`ISerializable.GetObjectData` Method]
|
||||
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/api/system.exception[`Exception` Class]
|
||||
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -228,4 +228,4 @@ The following check is not implemented because it is difficult to know exactly w
|
||||
|
||||
We find mostly classes that derive from Exception in the projects we test and that's why they might not be a good source for checking issues and false positives (statistically).
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -1,4 +1,4 @@
|
||||
ifdef::env-github,rspecator-view,env-vscode[]
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
'''
|
||||
== Implementation Specification
|
||||
@ -29,4 +29,4 @@ member declaration
|
||||
=== on 22 May 2017, 15:10:29 Ann Campbell wrote:
|
||||
Okay, then RSPEC-3434 is the related RSpec, altho it's scope is different. I've added it as 'related'
|
||||
|
||||
endif::env-github,rspecator-view,env-vscode[]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -85,3 +85,5 @@ False
|
||||
|
||||
Enable issues on unread attributes with a single underscore prefix
|
||||
****
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -106,3 +106,5 @@ ifdef::env-github,rspecator-view[]
|
||||
(visible only on this page)
|
||||
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -64,3 +64,5 @@ ifdef::env-github,rspecator-view[]
|
||||
(visible only on this page)
|
||||
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -204,3 +204,5 @@ In any other case, when a dangerous peer definition is identified:
|
||||
|
||||
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -250,3 +250,5 @@ In any other case, when a dangerous peer definition is identified:
|
||||
|
||||
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -135,3 +135,5 @@ ifdef::env-github,rspecator-view[]
|
||||
(visible only on this page)
|
||||
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -63,3 +63,5 @@ ifdef::env-github,rspecator-view[]
|
||||
(visible only on this page)
|
||||
|
||||
The implementation should be common with S4462. When implementing, should make sure S4462 will ignore Azure Functions.
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -119,3 +119,4 @@ For `wget`:
|
||||
|
||||
* Highlight the `wget` command and the URL.
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -82,6 +82,18 @@ fun compare(a: Int, b: Int): Int {
|
||||
}
|
||||
----
|
||||
|
||||
== Resources
|
||||
|
||||
=== Documentation
|
||||
|
||||
* https://kotlinlang.org/docs/control-flow.html#when-expression[Kotlin Docs, When expression]
|
||||
|
||||
=== Articles & blog posts
|
||||
|
||||
* https://www.baeldung.com/kotlin/when[Baeldung, Guide to the “when{}” Block in Kotlin]
|
||||
* https://superkotlin.com/kotlin-when-statement[Kotlin when: A switch with Superpowers]
|
||||
* https://www.sonarsource.com/resources/cognitive-complexity[G. Ann Campbell, Cognitive Complexity]
|
||||
|
||||
ifdef::env-github,rspecator-view[]
|
||||
|
||||
== Implementation Specification
|
||||
@ -99,16 +111,4 @@ ifdef::env-github,rspecator-view[]
|
||||
Number of "if" after which the chain should be replaced by a "when" statement.
|
||||
****
|
||||
|
||||
endif::[]
|
||||
|
||||
== Resources
|
||||
|
||||
=== Documentation
|
||||
|
||||
* https://kotlinlang.org/docs/control-flow.html#when-expression[Kotlin Docs, When expression]
|
||||
|
||||
=== Articles & blog posts
|
||||
|
||||
* https://www.baeldung.com/kotlin/when[Baeldung, Guide to the “when{}” Block in Kotlin]
|
||||
* https://superkotlin.com/kotlin-when-statement[Kotlin when: A switch with Superpowers]
|
||||
* https://www.sonarsource.com/resources/cognitive-complexity[G. Ann Campbell, Cognitive Complexity]
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -36,4 +36,6 @@ ifdef::env-github,rspecator-view[]
|
||||
|
||||
include::../common/message.adoc[]
|
||||
|
||||
'''
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -61,4 +61,6 @@ ifdef::env-github,rspecator-view[]
|
||||
|
||||
include::../common/message.adoc[]
|
||||
|
||||
'''
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
@ -40,3 +40,5 @@ include::../common/message.adoc[]
|
||||
include::../common/highlighting.adoc[]
|
||||
|
||||
'''
|
||||
|
||||
endif::env-github,rspecator-view[]
|
||||
|
Loading…
x
Reference in New Issue
Block a user