-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Implement trailing comma for comma-separated lists #74522
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
@swift-ci build toolchain |
@swift-ci build toolchain |
@mateusrodriguesxyz Would it be wise to add tests that exercise the code paths where you've made changes in response to @ahoppen? |
@swift-ci build toolchain |
@hborla as code owner and member of the language steering group do you have advice about how should I proceed now that SE-0439 has been accepted with modifications? Should I remove all code unrelated with the accepted design or the group wants to keep some of it (e.g: if/guard/while conditions) under an experimental flag? Should I ungate the accepted parts and remove the flag? I would appreciate any direction, thanks! |
@mateusrodriguesxyz Good question, thanks for asking!
Since this proposal doesn't need the experimental feature flag to be promoted to an upcoming feature flag, I recommend un-gating the accepted parts of the design, and leaving the flag in place to gate the parts of the design that were subsetted out. I also recommend splitting up the tests so that the parts of the tests that need the flag are in a separate file that enable the experimental feature, while the bulk of the tests don't enable the flag. |
@hborla following your recomendations I've ungated the accepted parts and moved the parts of the tests that need the flag to a diffeent file. I also removed support from |
@mateusrodriguesxyz Would you mind throwing in tests to ensure that |
I will look into this as soon as possible. |
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.
There are a lot of formatting changes here. Not sure if we want those changes, but at the very least they should be in their own PR to avoid cluttering the functional changes here, and to make it easier to merge/revert/cherry-pick/etc. this work.
Makes sense, I run the git-format and forget about this 😫 |
Got it. I'm not certain, so the safer route is not to add trailing comma support. |
I guess |
Yes, please do not mass-reformat existing code. It makes it nearly impossible to merge between branches without creating a large amount of conflicts. |
Sorry about the mess. Should I force push to replace the merge commit or make one reverting the formatting? |
FWIW, using I'd use force-push to undo the format changes; if you leave them in and add another commit to undo them, I think we can still end up with merge conflicts when trying to merge between branches. |
e49e013
to
ac57e61
Compare
That's a much nicer looking diff now, thanks! |
@swift-ci Please smoke test |
hey, just a novice here, what does it mean for a feature to be experimental, like this one? i can see that many features seems to be gated behind experimental flags, but what does it imply? is there a testing period (if so how long is it usually?) where good feedback will make the feature available by default? how does it work. sorry if this might not be the best place to ask it. also, i can see in the proposal that this was accepted with modifications, what are the modifications? will we be able to have trailing commas for function arguments? |
You can refer to the Swift Forums for information about new language features adopted through the Swift Evolution process. In this case, the acceptance with modifications is documented here. This feature isn't experimental, and no flags will be required to use it when it ships. It has not, however, shipped in any officially released version of Swift yet. You can check the release notes of any release to see what features are included in that release. You can try out development snapshots which contain new features not yet released by going to the Swift.org Install page. Experimental flags are a way to allow work-in-progress to be integrated and tested; they can be added and removed arbitrarily and, for end users, should be disregarded. User-facing features that are meant to be made available to end users generally go through the Swift Evolution process, which is conducted on the Swift Forums. While a feature is being pitched or reviewed as part of the Swift Evolution process, there may be experimental flags mentioned specifically or even custom toolchains so that everyone can try it out and give feedback, but you should not expect any experimental flags to continue working in the same way or at all. |
@mateusrodriguesxyz What’s the state of this feature? I can see that the Swift Evolution proposal SE-0439 has been accepted but the features is still guarded behind an experimental feature flag. |
I believe the experimental feature flag should be guarding those portions of the feature that were not accepted and everything else should be already enabled by default, as per @hborla's suggestion above. The proposal text itself has not been edited to incorporate the steering group's decision. |
Yes, the text is just outdated. I've been meaning to update the proposal to incorporate the steering group's decision but I've been pretty busy the last months. |
Ah, I remember now. Thanks for clarifying, @mateusrodriguesxyz. |
This is a implementation for swiftlang/swift-evolution#2344 gated behind
-enable-experimental-feature TrailingComma
. After feedback from the language steering group I have expanded the original proposal and implementation that I began in #71975.