Skip to content
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

Respect the with_spans parser option for annotations #201

Merged

Conversation

leamingrad
Copy link
Contributor

@leamingrad leamingrad commented May 31, 2024

This PR contains a small change to stop adding span information to Annotation elements when with_spans is set to False for the parser.

I've pulled this into its own PR because it wasn't obvious whether this behaviour was intentional or not (I could see an argument that annotations are a bit useless without span information). If this isn't needed, I'm happy to close this PR.

Note that the broken tests are unrelated to this PR, and are fixed in #203.

Prior to this change, all of the syntax tests covered the behaviour of
the parser when with_spans is set to True.

This change updates the test generation to create a version of each test
which tests the parser when with_spans is set to False. To achieve this,
we strip the span information from the expected file (rather than
needing to maintain two files).
Prior to this change, Annotations would always have span information,
irrespective of the value of the with_spans argument to the parser.

This change changes the behaviour to only include span information if
with_spans if set to True.
@leamingrad leamingrad force-pushed the respect-with-spans-for-annotations branch from 1193629 to 7cb7fac Compare June 3, 2024 11:58
Copy link
Member

@eemeli eemeli left a comment

Choose a reason for hiding this comment

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

This looks sensible. Apologies for taking so long to get at this.

It looks like there was a CI run for this that complained on flake, but it's not showing up in the PR?

@eemeli
Copy link
Member

eemeli commented Jul 26, 2024

Ah, the lint problem was fixed by the force push. Still confused by the CI results not showing up here.

@eemeli eemeli merged commit df5ef40 into projectfluent:main Jul 26, 2024
@leamingrad leamingrad deleted the respect-with-spans-for-annotations branch July 29, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants