Fix: natspec annotations on constructors#4542
Conversation
0702fe3 to
28c421c
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4542 +/- ##
===========================================
+ Coverage 87.55% 87.57% +0.01%
===========================================
Files 313 313
Lines 30810 30850 +40
Branches 3672 3665 -7
===========================================
+ Hits 26977 27016 +39
Misses 2579 2579
- Partials 1254 1255 +1
|
libsolidity/interface/Natspec.cpp
Outdated
There was a problem hiding this comment.
How about constructor = std::move(fillDevDocument(...) and fillDevDocumentation just return a Json::Value? That is a bit more consistent with the style we have.
There was a problem hiding this comment.
Ok, I change the method to return a Json::Value. But I think that std::move is not needed here, because the compiler will already do return value optimization.
libsolidity/interface/Natspec.cpp
Outdated
There was a problem hiding this comment.
I don't think return should be valid for the constructor.
c4ec267 to
15a9eee
Compare
There was a problem hiding this comment.
Shouldn't this be constructor and not plural? What is the field used for?
There was a problem hiding this comment.
Hmm.. I was also thinking about that, but then I saw that within DocStringAnalyser::handleCallable(..) functions is used, thats why I also used the plural here. It will be used to generate an error like Error: Doc tag @return not valid for constructors. - I had the feeling that plural is better readable.
There was a problem hiding this comment.
Looks like that you want to have the singular here.
c3cc43d to
835e663
Compare
|
@chfast hmm.. looks like that there is a problem with codecov, the current diff is not reflecting the actual changes.. or did i missed something?.. probably the lates analysis is just not yet finished.. was just wondering about that diff.. |
|
I guess the stuff just changed because of squashing some commits. Let's see ;) |
|
Codecov waits for all CI to complete, but when you force push commits to a PR it freak outs and can send out an invalid report. You will get a new one when AppVeyor finishes. |
|
@chfast thx! good to know |
|
@axic i saw accidentally that the natspecs are (now?) part of the meta-data. Regarding a potential change of the natspecs so that they may support arbitrary tags could have the advantage that users can add user-defined structured meta-data through those tags. |
libsolidity/interface/Natspec.cpp
Outdated
There was a problem hiding this comment.
style: { on a line of its own
28a8dbf to
d1673f3
Compare
There was a problem hiding this comment.
I think this indentation is not in line with the coding style.
There was a problem hiding this comment.
I think this indentation is not in line with the coding style.
| DocumentedAnnotation& _annotation | ||
| ) | ||
| { | ||
| static const set<string> validTags = set<string>{"author", "dev", "notice", "param"}; |
d1673f3 to
11b835b
Compare
- natspec annotations on constructore where ignored.
11b835b to
f76d4d5
Compare
|
I'm sorry, @axic is travelling and I somehow missed your update. |
|
@chriseth Any idea when we can expect to see this in a release? |
|
It will be part of 0.5.0. Sorry for the inconvenience. |
methodsnode and will just have the nameconstructor.Recreated PR. I recreated my
constructor_natspecbranch and cherry-picked the actual change. I wasn't aware of that this will also remove the original PR #3666, related to #1141.