Skip to content

Fix: natspec annotations on constructors#4542

Merged
chriseth merged 1 commit intoargotorg:developfrom
aarlt:constructor_natspec
Aug 14, 2018
Merged

Fix: natspec annotations on constructors#4542
chriseth merged 1 commit intoargotorg:developfrom
aarlt:constructor_natspec

Conversation

@aarlt
Copy link
Contributor

@aarlt aarlt commented Jul 22, 2018

  • natspec annotations on constructore where ignored.
  • as discussed: the constructor natspec will be placed within the methods node and will just have the name constructor.

Recreated PR. I recreated my constructor_natspec branch and cherry-picked the actual change. I wasn't aware of that this will also remove the original PR #3666, related to #1141.

@aarlt aarlt force-pushed the constructor_natspec branch 3 times, most recently from 0702fe3 to 28c421c Compare July 24, 2018 20:30
@codecov-io
Copy link

codecov-io commented Jul 24, 2018

Codecov Report

Merging #4542 into develop will increase coverage by 0.01%.
The diff coverage is 96.77%.

Impacted file tree graph

@@             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
Flag Coverage Δ
#all 87.57% <96.77%> (+0.01%) ⬆️
#syntax 28.32% <27.41%> (?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about constructor = std::move(fillDevDocument(...) and fillDevDocumentation just return a Json::Value? That is a bit more consistent with the style we have.

Copy link
Contributor Author

@aarlt aarlt Jul 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think return should be valid for the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah! Good catch!

@aarlt aarlt force-pushed the constructor_natspec branch 2 times, most recently from c4ec267 to 15a9eee Compare July 25, 2018 11:29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be constructor and not plural? What is the field used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that you want to have the singular here.

@aarlt aarlt force-pushed the constructor_natspec branch 2 times, most recently from c3cc43d to 835e663 Compare August 2, 2018 18:20
@aarlt
Copy link
Contributor Author

aarlt commented Aug 2, 2018

@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..

@aarlt
Copy link
Contributor Author

aarlt commented Aug 2, 2018

I guess the stuff just changed because of squashing some commits. Let's see ;)

@aarlt
Copy link
Contributor Author

aarlt commented Aug 2, 2018

@chfast for me it looks like an issue with codecov
@axic appveyor seem to hang.. probably because the initial commit was already done in march..

@chfast
Copy link
Contributor

chfast commented Aug 2, 2018

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.

@aarlt
Copy link
Contributor Author

aarlt commented Aug 2, 2018

@chfast thx! good to know

@aarlt
Copy link
Contributor Author

aarlt commented Aug 3, 2018

@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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: { on a line of its own

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@aarlt aarlt force-pushed the constructor_natspec branch 2 times, most recently from 28a8dbf to d1673f3 Compare August 7, 2018 18:52
chriseth
chriseth previously approved these changes Aug 8, 2018
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this indentation is not in line with the coding style.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation fixed.

@axic axic self-assigned this Aug 8, 2018
@aarlt aarlt force-pushed the constructor_natspec branch from d1673f3 to 11b835b Compare August 8, 2018 19:51
- natspec annotations on constructore where ignored.
@aarlt aarlt force-pushed the constructor_natspec branch from 11b835b to f76d4d5 Compare August 8, 2018 19:53
@aarlt
Copy link
Contributor Author

aarlt commented Aug 14, 2018

@axic @chriseth are there any problems with this PR?

@chriseth
Copy link
Contributor

I'm sorry, @axic is travelling and I somehow missed your update.

@chriseth chriseth merged commit 8f27fb1 into argotorg:develop Aug 14, 2018
@feuGeneA
Copy link

@chriseth Any idea when we can expect to see this in a release?

@chriseth
Copy link
Contributor

It will be part of 0.5.0. Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments