Skip to content

Commit

Permalink
Forbid 'title' and 'author' for state var natspecs.
Browse files Browse the repository at this point in the history
  • Loading branch information
aarlt committed Mar 24, 2020
1 parent c8700fe commit 9e6d5c4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion libsolidity/analysis/DocStringAnalyser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void DocStringAnalyser::handleDeclaration(
StructurallyDocumentedAnnotation& _annotation
)
{
static set<string> const validPublicTags = set<string>{"author", "title", "dev", "notice"};
static set<string> const validPublicTags = set<string>{"dev", "notice"};
parseDocStrings(_node, _annotation, validPublicTags, "state variables");
}

Expand Down
7 changes: 0 additions & 7 deletions test/libsolidity/SolidityNatspecJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ BOOST_AUTO_TEST_CASE(dev_public_state_variable)
{
char const* sourceCode = R"(
contract test {
/// @author example of author
/// @notice example of notice
/// @dev example of dev
uint public state;
Expand All @@ -218,7 +217,6 @@ BOOST_AUTO_TEST_CASE(dev_public_state_variable)
char const* natspec = "{"
"\"methods\":{"
" \"state()\":{ \n"
" \"author\": \"example of author\",\n"
" \"details\": \"example of dev\"\n"
" }\n"
"}}";
Expand All @@ -231,7 +229,6 @@ BOOST_AUTO_TEST_CASE(user_variable_declaration)
char const* sourceCode = R"(
contract test {
function f() public pure returns (uint) {
/// @author example of author
/// @notice example of notice
/// @dev example of dev
uint state = 42;
Expand All @@ -251,7 +248,6 @@ BOOST_AUTO_TEST_CASE(user_public_state_variable)
{
char const* sourceCode = R"(
contract test {
/// @author example of author
/// @notice example of notice
/// @dev example of dev
uint public state;
Expand All @@ -272,7 +268,6 @@ BOOST_AUTO_TEST_CASE(dev_private_state_variable)
{
char const* sourceCode = R"(
contract test {
/// @author example of author
/// @notice example of notice
/// @dev example of dev
uint private state;
Expand All @@ -283,7 +278,6 @@ BOOST_AUTO_TEST_CASE(dev_private_state_variable)
"\"methods\":{},\n"
"\"stateVariables\":{\n"
"\"state\":{\n"
"\"author\": \"example of author\",\n"
"\"details\": \"example of dev\"\n"
"}\n"
"}\n"
Expand All @@ -296,7 +290,6 @@ BOOST_AUTO_TEST_CASE(user_private_state_variable)
{
char const* sourceCode = R"(
contract test {
/// @author example of author
/// @notice example of notice
/// @dev example of dev
uint private state;
Expand Down

0 comments on commit 9e6d5c4

Please sign in to comment.