-
Notifications
You must be signed in to change notification settings - Fork 108
Implement reading of fpm.toml #157
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
Conversation
This is super exciting, thanks a lot @awvwgk! I look forward to reviewing it. |
Not sure on the scope of this PR, currently it allows to translate and verify any TOML document as The next step would be to pull in a dependency and translate and verify its package file, which would require to create new Regarding coding style, any conventions I should apply (mainly w.r.t. indentation)? |
@awvwgk thanks a lot for this PR! We will review it soon. I think the scope is ok as it is, and we can build upon it with further PRs once it is merged. |
Guess it is ready for review than. The current style guide I'm mostly following is this one: https://github.com/dftbplus/develguide/blob/master/docs/fortranstyle.rst |
We follow the stdlib style guide. I skimmed through the contributions and didn't see anything that jumps out except the indentation width (we use 4). |
Thanks, this is helpful. I've amended the commit accordingly to keep the history clean. |
I didn't dive super deep into it, but from the high level, it looks reasonably similar to the Haskell version, so I think it's probably at least headed in the right direction. I do have one question though. Would it be possible to write some unit tests for this? Feed it a toml string and make sure the package object is correct, feed it bad toml and make sure it reports an error, etc. |
Sure can do. |
That looks good for now. I was hoping it wouldn't require writing to the file, but it's ok for now. It's a slick little minimalist testing framework you put together too. |
I need to work on a better constructor for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @awvwgk! This all looks good to me. Good to see schema checks with useful error messages and a verbose mode.
My only (minor) complaint is naming with config
where I would have used manifest
(e.g. fpm_manifest
) to better describe, and distinguish from the existing settings
types used for command line. What do others think?
Due to the size of this PR I would recommend this be merged prior to mine and other PRs; I will rebase.
Good idea, Feel free to squash the PR into one commit to avoid the noise of renaming files. |
@awvwgk @everythingfunctional @LKedward Should this PR go before or after #155? Is either way easier than the other? I can't tell. |
I think this PR should go first because it's bigger. I'll then merge the changes into my branch. (Only conflict between the two is |
They are solving different problems, the order does not matter too much, but a conflict in Since #155 is attempting to add the functionality of fpm building itself, the question arises if we can retain this functionality with both PRs merged. In this regard my PR is working exactly against #155, due to adding an external dependency. |
This isn't a problem; parsing the manifest is more important than Fortran |
If @LKedward is happy to rebase his branch and fix the conflicts, I'd go with this one first. As much as I'd like to have fpm be able to build itself, it's not strictly necessary. We'll get there. |
I agree. Let's wait to see if @certik has any objections, and if not we can move forward. |
- fix unallocated access to error_t in file_not_found generator - account for fact that key-list will be allocated with size 0 for empty key-tables - test response of constructor on empty TOML tables
I did a quick coverage run on this PR (coverage.txt) and spotted a few issues which were simple oversights. The coverage is currently around 60%, so definitely something to improve. |
I am fine as long as @LKedward is fine, and it seems he his. So we can go ahead and merge this one. |
Also ready from my side now. I decided to pin the revision of |
Thank you all and especially @awvwgk. Merging. |
Uses my TOML library to read the
fpm.toml
file and creates a Fortran type representing the TOML document.This PR adds
toml-f
as dependency tofpm
.Closes #149