-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[pkg/stanza] Fully decompose the tokenize package #26241
Closed
djaglowski
wants to merge
2
commits into
open-telemetry:main
from
djaglowski:pkg-stanza-tokenize-simplify-2
Closed
[pkg/stanza] Fully decompose the tokenize package #26241
djaglowski
wants to merge
2
commits into
open-telemetry:main
from
djaglowski:pkg-stanza-tokenize-simplify-2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
djaglowski
changed the title
Pkg stanza tokenize simplify 2
[pkg/stanza] Fully decompose the tokenize package
Aug 28, 2023
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
from
August 28, 2023 20:02
570c03e
to
cc8d5a6
Compare
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
from
August 30, 2023 20:12
cc8d5a6
to
b7c82bc
Compare
djaglowski
added a commit
that referenced
this pull request
Aug 31, 2023
This just changes a very recently added package name. I think it matches typical naming conventions better, especially when viewed as part of #26241.
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
from
September 7, 2023 15:29
b7c82bc
to
9abd267
Compare
This was referenced Sep 7, 2023
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
2 times, most recently
from
September 7, 2023 18:00
f7be577
to
fa3b87e
Compare
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
from
September 8, 2023 10:02
fa3b87e
to
cdd0709
Compare
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
from
September 8, 2023 13:20
cdd0709
to
1b590d9
Compare
djaglowski
added a commit
that referenced
this pull request
Sep 8, 2023
Subset of #26241 This finally removes the `SplitterConfig` struct, which at this point is only a wrapper around `MultilineConfig`.
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
from
September 8, 2023 15:44
1b590d9
to
7864437
Compare
This was referenced Sep 8, 2023
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
from
September 8, 2023 19:35
7864437
to
b5beede
Compare
djaglowski
added a commit
that referenced
this pull request
Sep 11, 2023
Subset of #26241 Follows #26540 - Rename `MultilineConfig` to `split.Config` - Remove `Multiline`, previously a struct representation that only wrapped a split func - Remove `NewMultilineConfig`, because `split.Config` is just two simple fields with "" defaults. - Condense references in tests - Substantially increate test coverage in `split` package.
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
from
September 11, 2023 22:06
b5beede
to
b53e2b5
Compare
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
from
September 12, 2023 14:57
b53e2b5
to
fc17ae9
Compare
djaglowski
added a commit
that referenced
this pull request
Sep 12, 2023
Another few remaining parts of #26241. This basically follows up on renaming the `multiline` package by renaming a few remaining to "multiline" throughout the codebase.
djaglowski
force-pushed
the
pkg-stanza-tokenize-simplify-2
branch
from
September 12, 2023 15:07
fc17ae9
to
1646f4b
Compare
This has been broken down into several other PRs. What little remains may be picked up in future PRs. |
djaglowski
added a commit
that referenced
this pull request
Sep 13, 2023
Follows #26241 Previously, split funcs were responsible for applying trim funcs. This PR increases composability by applying trim funcs as a wrapper around split funcs. One nuance that was surfaced here is that the newline split func was not handling the case where a line starts with a newline. When this happens, we need to tell the scanner to advance, but we still want to return a `""` token, rather than nil. This is covered by existing tests, but previously it was "fixed" by the trim func which would return an empty slice when the token was nil. Now, the newline split func will explicitly handle this case, while the trim func will return the original value if it is nil or empty.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Major additional refactoring, following #26040.
I will peel off several smaller PRs while working towards this overall set of changes.
tokenize
package:SplitterConfig
and instead makes its fields more composable.flush
package which can apply a stateful time-based flush behavior to anybufio.SplitFunc
.Multline
struct in thetokenize
package, so renames the package tosplit
and the config tosplit.Config
.