sql: fix a bunch of minor spacing issues in the grammar#25216
sql: fix a bunch of minor spacing issues in the grammar#25216craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
|
How did you do this change? Did you automate it? How? |
|
If I automated it I would have included the steps. Finding the double, triple, quadruple spaces was easy. Just a search for The rest was looking for |
knz
left a comment
There was a problem hiding this comment.
This patch is a mixed bag of desirable stuff (the alignment of %type directives) and less desirable stuff. I wish we could break this up in multiple parts so we can discuss them separately.
I am also a little bit concerned that any subsequent patches on the 2.0 branch will get merge conflicts.
|
|
||
| // Note: newlines between non-terminals matter to the doc generator. | ||
|
|
||
| collation_name: unrestricted_name |
There was a problem hiding this comment.
This one-line change and those below don't seem justified - there's nothing to align wish, so why the different amount of spacing?
|
|
||
| %token <str> ZONE | ||
| %token <str> ZONE | ||
|
|
There was a problem hiding this comment.
All the changes above this point are not justified -- the code was homogeneous, there was no irregularity.
There was a problem hiding this comment.
That's not entirely true.
%token <*tree.NumVal> ICONST FCONST uses only one space already.
I just don't know of any instance in which we use a double spaces for
There was a problem hiding this comment.
ok let's keep your change here.
| %token NOT_LA WITH_LA AS_LA | ||
|
|
||
| %union { | ||
| id int |
There was a problem hiding this comment.
this struct change does not appear justiifed
There was a problem hiding this comment.
This one was weird. I don't understand the huge spacing. I can revert it.
| { | ||
| $$.val = &tree.AlterTableDropColumn{ | ||
| ColumnKeyword: $2.bool(), | ||
| IfExists: true, |
There was a problem hiding this comment.
from here on to my next comment, I see where you're coming from but I'm not sure the change is properly justified. I would even argue we're making a step back: because we don't have gofmt support for goyacc files (nor editor support to auto-align struct initializers), requiring extra spaces is actually extra work (now people have to manually align things with their space bar).
What do you think?
There was a problem hiding this comment.
More than half of these were already aligned as if it were using gofmt. So that's why I made the change. We should have a consistent style and we don't. I opted for the style that matches the rest of our codebase.
Manually adding the spaces ins't a big deal but without linter support, it will not be enforceable.
There IS yacc file support in a lot of editors, but our specific blend of go and the grammar broke every one that I tried.
There was a problem hiding this comment.
More than half of these were already aligned as if it were using gofmt.
I don't see that's true. Can you show me?
There was a problem hiding this comment.
Just went back through and did a bit of an audit of them. Most were not formatted. But there is a mix.
Take a look at the $$.val = &tree.CreateIndex{ Of the 4, 2 were formatted, 1 was not, and 1 was half formatted.
I'd still rather we format them in gofmt style to match the rest of our codebase. But I'll leave the final decision up to you. I find it more readable and I don't think the manual alignment is hard to do or enforce. But the most important thing here is to be consistent. So let me know either way.
knz
left a comment
There was a problem hiding this comment.
I am coming to like most of the changes. I still have reservations about the struct initializations. Please provide more information (see comment below).
|
|
||
| %token <str> ZONE | ||
| %token <str> ZONE | ||
|
|
There was a problem hiding this comment.
ok let's keep your change here.
| %token NOT_LA WITH_LA AS_LA | ||
|
|
||
| %union { | ||
| id int |
| { | ||
| $$.val = &tree.AlterTableDropColumn{ | ||
| ColumnKeyword: $2.bool(), | ||
| IfExists: true, |
There was a problem hiding this comment.
More than half of these were already aligned as if it were using gofmt.
I don't see that's true. Can you show me?
|
Let's skip the struct alignment for now unless you also can implement a linter for it straight away. I don't see anyone in the team willing (or able) to properly check this manually during future reviews. The rest LGTM Reviewed 1 of 1 files at r1, 1 of 1 files at r2. Comments from Reviewable |
I was trying to do some searching and couldn't find what I was looking for due to inconsistent spacing. We should move towards adding a linter for the grammer. Release note: None
|
Done. I've created a branch with just the spacing changes for for the struct alignment, so we don't have to start from scratch if we do move in that direction. https://github.com/BramGruneir/cockroach/tree/spacing2 Review status: 0 of 1 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
|
bors r+ |
|
Thanks! |
Merge conflict (retrying...) |
|
bors r+ |
Merge conflict (retrying...) |
|
bors r+ |
Build failed (retrying...) |
|
bors r+
…On Tue, May 15, 2018, 16:57 craig[bot] ***@***.***> wrote:
Build failed (retrying...)
- GitHub CI (Cockroach)
<https://teamcity.cockroachdb.com/viewLog.html?buildId=659931&buildTypeId=Cockroach_UnitTests>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25216 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABihuZexSEgDaORPwKpWfZe2bj2VPy4Bks5ty0EugaJpZM4TuVnL>
.
|
|
Not awaiting review |
25216: sql: fix a bunch of minor spacing issues in the grammar r=BramGruneir a=BramGruneir I was trying to do some searching and couldn't find what I was looking for due to inconsistent spacing. We should move towards adding a linter for the grammer. Release note: None 25322: storage: proactively renew r1's lease r=a-robinson a=a-robinson This mechanism won't scale incredibly well to proactively renewing all expiration-based leases since it'd require a goroutine per lease. It should be fine if we only auto-renew r1's lease, though. Fixes #24753 Release note: None ---------------- @bdarnell, do you have any suggestions for testing this? I've verified it manually, but it's hard to properly isolate this code in a realistic way. We could ratchet the lease durations way down and wait until the lease's expiration bumps, but that creates a timing-based test that is either flaky if we use a really short lease duration or slow if we use a long one. Co-authored-by: Bram Gruneir <bram@cockroachlabs.com> Co-authored-by: Alex Robinson <alexdwanerobinson@gmail.com>
Build succeeded |
I was trying to do some searching and couldn't find what I was looking for due
to inconsistent spacing.
We should move towards adding a linter for the grammer.
Release note: None