Skip to content

Removed GOTOs #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 13, 2022
Merged

Removed GOTOs #75

merged 6 commits into from
Jun 13, 2022

Conversation

jacobwilliams
Copy link
Member

@jacobwilliams jacobwilliams commented Jun 7, 2022

See #74

Removed all GOTO statements. The logic of the code has not changed, so the results some be identical as before.

@codecov
Copy link

codecov bot commented Jun 7, 2022

Codecov Report

Merging #75 (81ebe7e) into main (dc14d61) will increase coverage by 0.02%.
The diff coverage is 83.24%.

@@            Coverage Diff             @@
##             main      #75      +/-   ##
==========================================
+ Coverage   88.77%   88.80%   +0.02%     
==========================================
  Files           2        2              
  Lines        1221     1224       +3     
  Branches      456      456              
==========================================
+ Hits         1084     1087       +3     
  Misses         40       40              
  Partials       97       97              
Impacted Files Coverage Δ
src/minpack.f90 88.29% <83.24%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc14d61...81ebe7e. Read the comment docs.

@jacobwilliams jacobwilliams mentioned this pull request Jun 7, 2022
@ivan-pi
Copy link
Member

ivan-pi commented Jun 7, 2022

There seem to be changes in many places besides the few goto's. Presumably due to an indentation change? It makes it hard to review the actual changes.

@jacobwilliams
Copy link
Member Author

Yeah, it's just indenting since I added the new blocks and also removed some unnecessary if blocks. If you look at it with a diff that ignores whitespace it does look a little cleaner.

@certik
Copy link
Member

certik commented Jun 8, 2022

Here is how to get a clean diff:

Copy link
Member

@certik certik left a comment

Choose a reason for hiding this comment

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

I reviewed the simplified diff using the link I posted above, and it looks good, I don't see any bad change.

It'd be nice to get this reviewed by somebody else as well.

I noticed the Codecov is saying some lines are not tested, which is unrelated to this PR, but we should test every line eventually.

@jacobwilliams jacobwilliams changed the title WIP: removing GOTOs Removed GOTOs Jun 8, 2022
Copy link
Member

@awvwgk awvwgk left a comment

Choose a reason for hiding this comment

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

Overall the change looks good. Is there a better naming for the blocks / loops other than main, outer and inner?

@certik
Copy link
Member

certik commented Jun 13, 2022

@awvwgk thanks for the additional review. Are you ok with merging as is, and then we can improve naming of loop labels in subsequent PRs?

@awvwgk
Copy link
Member

awvwgk commented Jun 13, 2022

Sure go ahead with merging. Best open an issue about naming afterwards.

@certik
Copy link
Member

certik commented Jun 13, 2022

@jacobwilliams go ahead and merge this. If there are any issues, we'll fix it up afterwards.

@jacobwilliams jacobwilliams merged commit c0b5aea into fortran-lang:main Jun 13, 2022
@jacobwilliams jacobwilliams deleted the 74-goto branch June 13, 2022 14:25
@jacobwilliams
Copy link
Member Author

we should push something to master to make the test pass... it doesn't look good to have master failing. :)

the failures were parts of the code that were never tested (alternate options)... we can make tests for them... just haven't had time...

@certik
Copy link
Member

certik commented Jun 13, 2022

According to this: https://github.com/fortran-lang/minpack/commits/main, master (main) passes CI. So I don't see a problem?

@awvwgk
Copy link
Member

awvwgk commented Jun 13, 2022

we should push something to master to make the test pass... it doesn't look good to have master failing. :)

Definitely not, if there is a concern about not passing the codecov patch check, it should be addressed in the PR, not by pushing a commit which doesn't affect coverage and automatically passes the patch check.

Personally, I think it is okay fail the codecov check by a small margin, 5% here. The default for the patch check is that everything fails which has a lower patch coverage than the current project coverage. However, I consider the codecov check more like a help for the reviewers, if it flags serious coverage loss or the patch coverage is almost zero, we know there is something wrong.

Of course, it is always preferred to improve the testing to pass the codecov patch check ;). Also, note that a 100% coverage is practically out-of-reach for any Fortran project at the moment due to the way the coverage maps back from the internal representation to the actual source lines.

@jacobwilliams
Copy link
Member Author

weird... the patch test did pass when I merged it... No idea why!! :)

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.

4 participants