-
Notifications
You must be signed in to change notification settings - Fork 100
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
cumbersome flag attributes #408
cumbersome flag attributes #408
Conversation
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.
Nice one @dianaoigo.
Could you try to add a DCO check
There is a requirement in ppxlib's to have signed commits... I think you just need to run:
git commit --amend --signoff
and force push to replace the current commit with a signed commit.
Thanks! The code is perfect. You need a few things to make the CI happy though:
And to make the documentation happy, you need to move your new entries in the signature. Indeed, the |
@panglesd thank you so much for your guidance. switching between working on different projects sometimes makes one forget some things. i will make the changes asap. |
Hello @dianaoigo, I think to sign-off the commits that have already been pushed, Use Run Find the line that corresponds to the commit you want to edit, and change the command from pick to edit. Save and close the file. Run After making your changes, save and close the file. Run |
68f6ce3
to
615ff2b
Compare
@panglesd after some serious fight and going in circles, i believe everything is in order. |
@Burnleydev1 @marrious11 thank you so much for the help |
@dianaoigo nice job! Indeed, all commits are now signed :) I still have a few comments:
Writing good doc-comment is not an easy job, especially for newcomers in this codebase, but it is a very good exercise! |
@panglesd thank you for the guidance, i will familiarize myself more with writing good-doc. Do i still need to make the changes suggested? |
Unless you don't want to or don't have time (which I'll perfectly understand and do the changes myself!), yes the changes are necessary to get the PR merged! |
@panglesd i would love to do them but i will kindly request that you do them so that i can learn from what you do |
4e5a938
to
3f43ec1
Compare
@dianaoigo I finally fixed the docstrings! (Sorry for the long delay). I added a non raising version of Finally, I added a test. Feel free to ask any question if you want some clarifications! |
@panglesd you made it look too easy with writing the docs. I'll get it with more practice |
Signed-off-by: dianaoigo <[email protected]>
Signed-off-by: dianaoigo <[email protected]>
Signed-off-by: dianaoigo <[email protected]>
Signed-off-by: dianaoigo <[email protected]>
Signed-off-by: Paul-Elliot <[email protected]>
3f43ec1
to
bae3fa8
Compare
Signed-off-by: Paul-Elliot <[email protected]>
Signed-off-by: Paul-Elliot <[email protected]>
ee15399
to
ade4878
Compare
Signed-off-by: dianaoigo <[email protected]> Co-authored-by: Paul-Elliot <[email protected]>
Thanks @dianaoigo ! |
CHANGES: - Fix `Longident.parse` so it properly handles unparenthesized dotted operators such as `+.` or `*.`. (ocaml-ppx/ppxlib#111, @rgrinberg, @NathanReb) - raising an exception does no longer cancel the whole context free phase(ocaml-ppx/ppxlib#453, @Burnleydev1) - Sort embedded errors that are appended to the AST by location so the compiler reports the one closer to the beginning of the file first. (ocaml-ppx/ppxlib#463, @NathanReb) - Update `Attribute.get` to ignore `loc_ghost`. (ocaml-ppx/ppxlib#460, @ceastlund) - Add API to manipulate attributes that are used as flags (ocaml-ppx/ppxlib#408, @dianaoigo) - Update changelog to use ISO 8061 date format: YYYY-MM-DD. (ocaml-ppx/ppxlib#445, @ceastlund) - Replace `Caml` with `Stdlib`. (ocaml-ppx/ppxlib#427, @ceastlund) - When a transformation raises, the last valid AST is used as input to the upcoming transformations. All such errors are collected and appended as extension nodes to the final AST (ocaml-ppx/ppxlib#447, @Burnleydev1) - Fix a small mistake in the man pages: Embededding errors is done by default with `-as-pp`, not with `-dump-ast` (ocaml-ppx/ppxlib#464, @pitag-ha) - Set appropriate binary mode when writing to `stdout` especially for Windows compatibility. (ocaml-ppx/ppxlib#466, @jonahbeckford)
CHANGES: - Add an optional `embed_errors` argument to `Context_free.map_top_down` that controls how to deal with exceptions thrown by context-free rules. (ocaml-ppx/ppxlib#468, @NathanReb) - Fix `Longident.parse` so it properly handles unparenthesized dotted operators such as `+.` or `*.`. (ocaml-ppx/ppxlib#111, @rgrinberg, @NathanReb) - raising an exception does no longer cancel the whole context free phase(ocaml-ppx/ppxlib#453, @Burnleydev1) - Sort embedded errors that are appended to the AST by location so the compiler reports the one closer to the beginning of the file first. (ocaml-ppx/ppxlib#463, @NathanReb) - Update `Attribute.get` to ignore `loc_ghost`. (ocaml-ppx/ppxlib#460, @ceastlund) - Add API to manipulate attributes that are used as flags (ocaml-ppx/ppxlib#408, @dianaoigo) - Update changelog to use ISO 8061 date format: YYYY-MM-DD. (ocaml-ppx/ppxlib#445, @ceastlund) - Replace `Caml` with `Stdlib`. (ocaml-ppx/ppxlib#427, @ceastlund) - When a transformation raises, the last valid AST is used as input to the upcoming transformations. All such errors are collected and appended as extension nodes to the final AST (ocaml-ppx/ppxlib#447, @Burnleydev1) - Fix a small mistake in the man pages: Embededding errors is done by default with `-as-pp`, not with `-dump-ast` (ocaml-ppx/ppxlib#464, @pitag-ha) - Set appropriate binary mode when writing to `stdout` especially for Windows compatibility. (ocaml-ppx/ppxlib#466, @jonahbeckford)
CHANGES: - Add an optional `embed_errors` argument to `Context_free.map_top_down` that controls how to deal with exceptions thrown by context-free rules. (ocaml-ppx/ppxlib#468, @NathanReb) - Fix `Longident.parse` so it properly handles unparenthesized dotted operators such as `+.` or `*.`. (ocaml-ppx/ppxlib#111, @rgrinberg, @NathanReb) - raising an exception does no longer cancel the whole context free phase(ocaml-ppx/ppxlib#453, @Burnleydev1) - Sort embedded errors that are appended to the AST by location so the compiler reports the one closer to the beginning of the file first. (ocaml-ppx/ppxlib#463, @NathanReb) - Update `Attribute.get` to ignore `loc_ghost`. (ocaml-ppx/ppxlib#460, @ceastlund) - Add API to manipulate attributes that are used as flags (ocaml-ppx/ppxlib#408, @dianaoigo) - Update changelog to use ISO 8061 date format: YYYY-MM-DD. (ocaml-ppx/ppxlib#445, @ceastlund) - Replace `Caml` with `Stdlib`. (ocaml-ppx/ppxlib#427, @ceastlund) - When a transformation raises, the last valid AST is used as input to the upcoming transformations. All such errors are collected and appended as extension nodes to the final AST (ocaml-ppx/ppxlib#447, @Burnleydev1) - Fix a small mistake in the man pages: Embededding errors is done by default with `-as-pp`, not with `-dump-ast` (ocaml-ppx/ppxlib#464, @pitag-ha) - Set appropriate binary mode when writing to `stdout` especially for Windows compatibility. (ocaml-ppx/ppxlib#466, @jonahbeckford)
@panglesd i have made some progress from the very helpful pointers you gave. kindly review and advise.
In my solution, i added specification in the src/attribute.mli then declared the attribute with a unit continuation. an empty payload pattern is created and passed to declare_with_all_args with a unit continuation. The has_flag function then checks if the attribute is present for the given value of x and returns a boolean value accordingly, with an optional mark_as_seen parameter that can be used to mark the attribute as seen if needed.