fktn-k / fkYAML

A C++ header-only YAML library
MIT License
69 stars 7 forks source link

#292 Better handling for flow indicators in permitted scalar contexts #293

Closed stephenwhittle closed 6 months ago

stephenwhittle commented 6 months ago

This PR addresses #292 by checking if the lexer is in a flow context before treating flow indicators, commas, or colons as terminating plain unquoted strings.

Pull Request Checklist

Read the CONTRIBUTING.md file for detailed information.

Please don't

coveralls commented 6 months ago

Coverage Status

coverage: 100.0%. remained the same when pulling 3cc81013aee5dfa151cde36382cce138d1eda19b on stephenwhittle:bugfix-allow_flow_indicators_in_plain_scalars into 04e1a7b9115398ae8c57c0f5263dcb8390e3dc32 on fktn-k:develop.

stephenwhittle commented 6 months ago

As you can see, there's a fair bit of noise on this PR from me tweaking the tests to ensure proper coverage, and forgetting to run the amalgamation script a time or two. Serves me right for working late ;) However, is that generating a bunch of noise on your end for the failed runs? If so, is there a way I can import your Actions workflows into my fork? Would rather do all this iteration over there prior to opening a PR, instead of spamming you with notifications about failures.

fktn-k commented 6 months ago

@stephenwhittle
First of all, no worries!
It didn't bother me since I've turned off the notification before when I did the same LOL.

Rather, I'm sorry for not mentioning the way of checking test coverage in the CONTRIBUTING.md, I usually develop this library and run lcov & genhtml (as done in the Makefile here) on Ubuntu 22.04LTS (WSL2).
I use the default version fetched from the apt repository.
If you don't use WSL, though not for the "pure" Windows environment, I've seen some article which said that the tools are also available with pacman on MSYS2.
Hope this will help.

is there a way I can import your Actions workflows into my fork?

Regarding this one, I honestly don't know at all...
I'll look for some ways to achieve that for future contributions though.

fktn-k commented 6 months ago

@stephenwhittle
I've found a way in which you can run the actions in your fork repository after some experiments in my fork from another one.

  1. Go to the "Settings >> Actions >> General" settings section
  2. Make sure the "Actions permissions" setting in your fork repository is not set to "Disable actions".
  3. Update the develop branch in your fork repository up-to-date
  4. Create a PR to YOUR develop branch to check the workflow results.
    When your changes get ready, just discard the PR if it's not necessary anymore.
  5. Create a PR to my develop branch as usual.

I've confirmed that the above steps do nothing to the upstream repository.
If they wouldn't work to this repository... I don't care! Just give it a try!

stephenwhittle commented 6 months ago

A few notes @fktn-k -

fktn-k commented 6 months ago

@stephenwhittle
Thanks for sharing the notes!

Coveralls gives me a clickable link to the build, but when trying to inspect a coverage report for a specific file I get HTTP 500 errors from their site.

This happens to me as well... (I got a 504 (timeout) error. The same on your end?)
image
The same error happens to other repositories (see this issue), and there seems no way to get a report back from Coveralls (see this comment). So, I'm looking to create a CI step to upload a zipped HTML view generated from the uploaded coverage data, what do you think?

It might be worth refactoring or restructuring such a function so it can be used more generally, as it's less prone to errors in the case of get_next (ie no risk of a forgotten call to unget) when we only need a single-character lookahead.

That's more reasonable. I agree with the change to make it less prone to errors, like replacing test_next_char with something like peek_next which just returns a next character without changing the current position.

It may also be worth investigating if there are other compiler flags we should be passing to disable inlining during code coverage checks as it seems to be occurring even at O0 optimization level.

Agree. I made some workarounds to avoid such issues before (I just recalled that). There should be some option to keep the compiler from expanding any functions inline.