rspec/rules/S1888/rule.adoc

30 lines
642 B
Plaintext
Raw Normal View History

This rule allows you to check for certain types of comments before each method. For example, you may want to check for a Doxygen @author comment before each method.
== Noncompliant Code Example
2021-01-27 13:42:22 +01:00
With regular expression: ``++//! @brief[ \t]+[a-zA-Z ]+++``:
2022-02-04 17:28:24 +01:00
[source,text]
----
bool TEST_CLASS_OK::Method(int nArg) // Noncompliant
{
return true;
}{code}
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,text]
----
//-------------------------------------------------------------------------
//! @brief Method
//-------------------------------------------------------------------------
bool TEST_CLASS_OK::Method(int nArg)
{
return true;
}
----