Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork59
Formatting fixes for YARP#394
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
csabahenk wants to merge1 commit intoruby-syntax-tree:yarpChoose a base branch fromcsabahenk:yarp
base:yarp
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Open
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or 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
Following issues are addressed:---"constant misnomer (has: AssocSplat, should have: AssocSplatNode) brings on formatting failure": "{a => b}"hash label key duplicated: "{a: b}"identity hash formatting failure: "{a:}"mixed hash content loss: "{a => b, c: d}"funcall with kwargs gets bogus '=>': "fun(a: b)""empty #call formatting failure": fun[]"#-@ appended to arg": "-1"empty funcall formatting failure: fun()empty super call formatting failure: super()ternary conditional formatting failure: "a ? b : c"incorrect postfix unless for compound statements: unless a; b; c; endAlternationPatternNode: foo => bar | bazCallOperatorAndWriteNode: foo.bar &&= valueCallOperatorOrWriteNode: foo.bar ||= valueClassVariableOperatorAndWriteNode: "@@target &&= value"ClassVariableOperatorOrWriteNode: "@@target ||= value"ClassVariableOperatorWriteNode: "@@target += value"ConstantOperatorAndWriteNode: Target &&= valueConstantOperatorOrWriteNode: Target ||= valueConstantOperatorWriteNode: Target += valueConstantPathOperatorWriteNode: Parent::Child += valueConstantPathOperatorAndWriteNode: Parent::Child &&= valueConstantPathOperatorOrWriteNode: Parent::Child ||= valueGlobalVariableOperatorAndWriteNode: $target &&= valueGlobalVariableOperatorOrWriteNode: $target ||= valueGlobalVariableOperatorWriteNode: $target += valueInstanceVariableOperatorAndWriteNode: "@target &&= value"InstanceVariableOperatorOrWriteNode: "@target ||= value"InstanceVariableOperatorWriteNode: "@target += value"KeywordHashNode: "[**{}]"LocalVariableOperatorAndWriteNode: target &&= valueLocalVariableOperatorOrWriteNode: target ||= valueOrNode: left or rightRequiredDestructuredParameterNode: def foo((bar, baz)); endSourceFileNode: __FILE__SourceLineNode: __LINE__SourceEncodingNode: __ENCODING__Notes:- Entries associated with a YARP Node class indicate a formatting failure due to #format method not being implemented for given class; so in these cases the fix boils down to implementing format.- For these entries the sample code that's given in the entry is the sample code from the YARP definition (config.yml), with one exception: the sample code for KeywordHashNode is 'foo(a: b)', but for that expression the formatting code preempts winding down to the KeywordHashNode instance, so the lack of KeywordHashNode#format is not triggered. The expression given for KeywordHashNode does indeed trigger KeywordHashNode#format. (Ironically, 'foo(a: b)' still had a formatting issue, but for a different reason.)- The aforementioned class tagged entries and the ones where "formatting failure" is indicated raise an exception with SyntaxTree::Formatter.format; the other cases do return but with a bogus result.- The hash related issues (ones where the word 'hash' occurs in the label, entries 2. to 4.) are shadowed by the first one (constant misnomer). Without fixing the name these entries will also end up with an exception. When the constant name is fixed, the indicated issue will be present.Tested with YARP 0eb5f7c3.
As the build setup does not integrate YARP (which is not even available on Rubygems.org ATM), all CI cases fail on |
Sign up for freeto 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.
Uh oh!
There was an error while loading.Please reload this page.
Following issues are addressed:
Notes:
failure due to #format method not being implemented for given
class; so in these cases the fix boils down to implementing format.
sample code from the YARP definition (config.yml), with one exception:
the sample code for KeywordHashNode is 'foo(a: b)', but for that
expression the formatting code preempts winding down to the
KeywordHashNode instance, so the lack of KeywordHashNode#format is
not triggered. The expression given for KeywordHashNode does indeed
trigger KeywordHashNode#format. (Ironically, 'foo(a: b)' still had
a formatting issue, but for a different reason.)
"formatting failure" is indicated raise an exception with
SyntaxTree::Formatter.format; the other cases do return but with a
bogus result.
entries 2. to 4.) are shadowed by the first one (constant misnomer).
Without fixing the name these entries will also end up with an exception.
When the constant name is fixed, the indicated issue will be present.
Tested with YARP0eb5f7c3..