RULEAPI-666: Migrate the "List of parameters", "Highlighting" and "Message" fields from jira RSPEC (#346)

This commit is contained in:
Arseniy Zaostrovnykh 2021-09-20 15:38:42 +02:00 committed by GitHub
parent 99eefa300d
commit f7904cebe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10390 changed files with 73379 additions and 8 deletions

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* Description: Regular expression used to check the [method|function|subroutine] names against
* Default: ^([A-Z0-9_]*|[a-z0-9_]*)$
* Type: STRING

View File

@ -19,6 +19,15 @@ ENDMETHOD.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -15,6 +15,13 @@ public void doSomething(){...}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* description = Regular expression used to check the function names against
* default = ^[a-z][a-zA-Z0-9]*$
* type = STRING

View File

@ -15,6 +15,15 @@ void doSomething (void);
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -29,6 +29,13 @@ void My_method_(){...} // invalid, leading and trailing underscores are reported
https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions[Microsoft Capitalization Conventions]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* Description: Regular expression used to check the [method|function|subroutine] names against
* Default value: ^[a-z][a-zA-Z0-9]*$
* Type: STRING

View File

@ -15,6 +15,15 @@ function doSomething(){...}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* Description: Regular expression used to check the function names against
* Default value: ^[a-zA-Z0-9]+$
* Type: STRING

View File

@ -19,6 +19,15 @@ func executeAll() {
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* Description: Regular expression used to check the method names against
* Default value: ^[a-z][a-zA-Z0-9]*$
* Type: STRING

View File

@ -24,6 +24,15 @@ public int Do_Something(){...}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* Description: Regular expression used to check the [method|function|subroutine] names against
* Default value: ^[_a-z][a-zA-Z0-9]*$
* Type: STRING

View File

@ -15,6 +15,15 @@ function doSomething(){...}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -1,6 +1,13 @@
include::../rule.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)

4
rules/S100/message.adoc Normal file
View File

@ -0,0 +1,4 @@
=== Message
Rename [method|function|subroutine] "XXXX" to match the regular expression ${format}.

View File

@ -0,0 +1,7 @@
=== Parameters
* key = format
* Description: Regular expression used to check the [method|function|subroutine] names against
* Default: ^[a-z][a-zA-Z0-9]*$

View File

@ -30,6 +30,15 @@ function myFunc(){...}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* description = Regular expression used to check the [method|function|subroutine] names against
* default = ^[a-z_][a-z0-9_]*$
* type = STRING

View File

@ -19,6 +19,15 @@ class MyClass:
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,7 @@
=== Parameters
* key = format
* Description: Regular expression used to check the subroutine names against
* Default: ^SR[a-zA-Z0-9]*$

View File

@ -33,6 +33,15 @@ C ENDSR
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* Description: Regular expression used to check the function
* Default: [a-z_][a-z0-9_]\{2,}$
* Type: STRING

View File

@ -1,6 +1,15 @@
include::../rule.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -19,6 +19,13 @@ def doSomething( ) : Unit = {
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* Description: Regular expression used to check the function names against
* Default value: ^[a-z][a-zA-Z0-9]*$
* Type: STRING

View File

@ -1,6 +1,15 @@
include::../rule.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Declaration of "xxx" is not introduced by the using-declaration on line "yyy".

View File

@ -8,6 +8,13 @@ This rule is a strict implementation of a MISRA (Motor Industry Software Reliabi
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,6 @@
=== Message
Remove this using-directive.
Remove this using-declaration.

View File

@ -59,6 +59,13 @@ The issue only happens if the using directive is at global scope or at namespace
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Remove this "RETURN" statement.

View File

@ -19,6 +19,13 @@ END;
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -61,6 +61,13 @@ int main() {
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,7 @@
=== Message
* Use the default parameter value defined in the overridden method.
* Remove the default parameter value to match the signature of overridden method.
* Add the default parameter value defined in the overridden method.
* Remove the default parameter value from this explicit interface implementation.

View File

@ -80,6 +80,13 @@ public class Program
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

4
rules/S1006/message.adoc Normal file
View File

@ -0,0 +1,4 @@
=== Message
Remove the default value for parameter "xxx" or set it to the same value as in the base class.

View File

@ -0,0 +1,4 @@
=== Message
Replace the enum type "xxx" with a type which is explicitly "signed" or "unsigned".

View File

@ -26,3 +26,12 @@ struct S
* MISRA {cpp}:2008, 9-6-3 - Bit-fields shall not have enum type.
* ISO/IEC 14882:2003
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
endif::env-github,rspecator-view[]

View File

@ -0,0 +1,7 @@
=== Parameters
* key = format
* Description : Regular expression used to check the class names against.
* Default: ^([A-Z0-9_]*|[a-z0-9_]*)$

View File

@ -19,6 +19,15 @@ ENDCLASS.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -15,6 +15,13 @@ class MyClass {}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* description = Regular expression used to check the class names against.
* default = ^[A-Z][a-zA-Z0-9]*$
* type = STRING

View File

@ -31,6 +31,15 @@ class Foo // Compliant
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,5 @@
=== Message
* Rename [class|interface|struct] "XXX" to match PascalCase naming rules, consider using "Xxx".
* Rename [class|interface|struct] "XXX" to match PascalCase naming rules, trim underscores from the name.

View File

@ -31,6 +31,13 @@ class Some_Name_XC {...} // invalid because of XC, should be Some_Name_Xc
* https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/capitalization-conventions[Microsoft Capitalization Conventions]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,7 @@
=== Parameters
* key = format
* Description : Regular expression used to check the class names against.
* Default value : ^[A-Z][a-zA-Z0-9]*$

View File

@ -15,6 +15,15 @@ public class MyClass {...}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -21,6 +21,13 @@ type myStruct struct {...}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,7 @@
=== Parameters
* key = format
* Description : Regular expression used to check the class names against.
* Default value : ^[A-Z][a-zA-Z0-9]*$

View File

@ -1,6 +1,15 @@
include::../rule.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,7 @@
=== Parameters
* key = format
* Description : Regular expression used to check the class names against.
* Default value : ^[A-Z][a-zA-Z0-9]*$

View File

@ -5,6 +5,15 @@ include::../noncompliant.adoc[]
include::../compliant.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,7 @@
=== Parameters
* key = format
* Description : Regular expression used to check the class names against.
* Default value : ^[A-Z][a-zA-Z0-9]*$

View File

@ -1,6 +1,15 @@
include::../rule.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

4
rules/S101/message.adoc Normal file
View File

@ -0,0 +1,4 @@
=== Message
Rename class "XXXX" to match the regular expression ${format}.

View File

@ -0,0 +1,7 @@
=== Parameters
* key = format
* Description : Regular expression used to check the class names against.
* Default value : ^[A-Z][a-zA-Z0-9]*$

View File

@ -1,6 +1,15 @@
include::../rule.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,7 @@
=== Parameters
* key = format
* description = Regular expression used to check the class names against.
* default = ^_?([A-Z_][a-zA-Z0-9]{empty}*|[a-z_][a-z0-9_]{empty}*)$

View File

@ -32,6 +32,15 @@ class my_context_manager:
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -19,6 +19,13 @@ end
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -1,6 +1,13 @@
include::../rule.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,7 @@
=== Parameters
* key = format
* Description : Regular expression used to check the class names against.
* Default value : ^[A-Z][a-zA-Z0-9]*$

View File

@ -1,6 +1,15 @@
include::../rule.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Rename this class to match the regular expression: "xxx".

View File

@ -0,0 +1,8 @@
=== Parameters
* key = format
* description = Regular expression used to check the class names against.
* default = ^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$
* type = STRING

View File

@ -25,6 +25,15 @@ End Class
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Refactor this "virtual" inheritance.

View File

@ -15,6 +15,13 @@ class D: public virtual B {}; // Noncompliant, B is a virtual base
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Remove the "virtual" specifier on class "xxx".

View File

@ -18,6 +18,13 @@ class D: public virtual A {}; // Noncompliant, D is not part of a diamond-shaped
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Class "xxx" derives from class "yyy" but lacks the "virtual" modifier.

View File

@ -29,6 +29,13 @@ class C: public B1, B2, B3 {}; // Compliant, A is always virtual
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
"xxx" defined in "yyy" clashes with definition in "zzz" in "filename" on line "line" and should be renamed.

View File

@ -44,6 +44,13 @@ For the purposes of this rule, visible function identifiers that form an overloa
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
This definition of virtual function "xxx" clashes with an existing definition in class "yyy".

View File

@ -100,6 +100,13 @@ d.f1(); // also calls B1::foo "by dominance"
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
{cpp}98 or {cpp}03: Annotate this function with "virtual".

View File

@ -39,6 +39,13 @@ class Derived : public Base
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Highlighting
``++= 0++``

View File

@ -0,0 +1,4 @@
=== Message
Convert this pure "virtual" function to a "virtual" function with a definition, or completely remove its declaration.

View File

@ -42,6 +42,15 @@ struct B : A {
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Remove this [use of "typeid"|use of "dynamic_cast"|virtual call to method "xxx"]

View File

@ -42,6 +42,13 @@ public:
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
This code within a copy constructor might not be executed and should be removed.

View File

@ -28,6 +28,13 @@ private:
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Mark this copy constructor of an abstract class "protected" or "private".

View File

@ -57,6 +57,13 @@ void f1( B1 & b1, B1 & b2 )
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Add an explicit copy constructor to this class.

View File

@ -32,6 +32,13 @@ void f ( A const & a1 )
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Add an explicit copy assignment operator to this class.

View File

@ -39,6 +39,13 @@ void f ( A const & a1, A & a2 )
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
Use a qualified-id or "this->" to access "xxx".

View File

@ -71,6 +71,13 @@ template class A<int32_t>;
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
\[Operator|Function] "xxx" is declared after the template declaration.

View File

@ -49,6 +49,13 @@ int main ( )
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -0,0 +1,4 @@
=== Message
"xxx" is never instantiated. It should be removed or referenced at least once.

View File

@ -32,6 +32,13 @@ This rule does not apply to libraries.
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -1,6 +1,15 @@
include::../rule.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

View File

@ -1,6 +1,15 @@
include::../rule.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../parameters.adoc[]
'''
== Comments And Links
(visible only on this page)

Some files were not shown because too many files have changed in this diff Show More