GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add editorconfig & jshint. by stephenplusplus · Pull Request #92 · googleapis/google-cloud-node

Conversation

@stephenplusplus

@stephenplusplus stephenplusplus commented Aug 4, 2014

Copy link
Copy Markdown
Contributor

I know these crazy change sets aren't fun. Sorry :(

This PR introduces editorconfig and JSHint. The configuration files are at root level, then I went through and ran it against the code, which is how we got to the huge diff. There are some things I'm not crazy about; mainly the 80 character limit. There are a few cases in here where splitting into a new line just makes things ugly.

I hate to even say this, being that the diff is so huge, but this is still just an initial "sweep." There are other code-style things that I think can still be addressed.

Please take a look. You'll notice lots of new lines, semi-colons, variable renaming, variable declaring, use strict atop every file, and other small things. I'm happy to tighten or loosen any of these rules and go back over the code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
stephenplusplus
stephenplusplus reviewed Aug 4, 2014
View reviewed changes
Comment thread package.json Outdated

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rakyll

rakyll commented Aug 4, 2014

Copy link
Copy Markdown
Contributor

This is great, much needed! I left some comments.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rakyll rakyll added this to the M1: core, datastore & storage milestone Aug 5, 2014
@stephenplusplus

stephenplusplus commented Aug 5, 2014

Copy link
Copy Markdown
Contributor Author

Combing over everything now 💇

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rakyll

rakyll commented Aug 5, 2014

Copy link
Copy Markdown
Contributor

Ooops, can't merge automatically. Could you resolve the conflicts?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Aug 5, 2014

Copy link
Copy Markdown
Contributor Author

Just went through it and left in a second commit if you want to see that diff to make sure I'm following our new rules :).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rakyll

rakyll commented Aug 5, 2014

Copy link
Copy Markdown
Contributor

Too many vars :D Please let's do it for constants, enums only, please.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Aug 5, 2014

Copy link
Copy Markdown
Contributor Author

Too many vars :D Please let's do it for constants, enums only, please.

Haha. I think we have to stick to one style. We would run into the issue of having no sensible, detectable style guide. I think the problem we were solving for (this looking weird)...

var something = 'ok',
    somethingElse =
        'a really long string that goes on forever' +
        'and ever and ever',
    anotherThing = 3;

...so we instead isolated the long decl...

var anotherThing = 3;
var something = 'ok';

var somethingElse =
        'a really long string that goes on forever' +
        'and ever and ever';

...is something that will come up, const or not. Going through the code, I also came across another example of an exception to the rule:

// ...
var namespaceRegex = /^[A-Za-z]*$/;

/**
 * Conversion dict for query operation to operation proto value.
 * @type {Object}
 */
var opToOperatorDict = {
  '=':  'EQUAL',
  // ...

So our rule would be, use comma separation for var declarations, unless it's a constant, has a doc block, or is a really long string. I think we're opening the doors for headaches with that! Much more straightforward to use multiple var decls everywhere, imo.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Aug 5, 2014

Copy link
Copy Markdown
Contributor Author

And thank gosh, I finally fixed the merge conflicts! :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

stephenplusplus
stephenplusplus reviewed Aug 5, 2014
View reviewed changes
Comment thread test/datastore.entity.js

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rakyll

rakyll commented Aug 5, 2014

Copy link
Copy Markdown
Contributor

I think we're opening the doors for headaches with that! Much more straightforward to use multiple var decls everywhere, imo.

I think it'll be pretty straightforward to ask for such tweaks -- giving the fact that it's only a problem for long strings. Styling is about readability, we can't explain the verbosity of unnecessary vars either.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rakyll

rakyll commented Aug 5, 2014

Copy link
Copy Markdown
Contributor

OTOH, could you add yourself to CONTRIBUTORS file?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Aug 5, 2014

Copy link
Copy Markdown
Contributor Author

I think it'll be pretty straightforward to ask for such tweaks -- giving the fact that it's only a problem for long strings. Styling is about readability, we can't explain the verbosity of unnecessary vars either.

It's actually common to use multiple variable declarations. We aren't the exception to the standard here-- the truth is, either way is just as likely to be seen in a JS codebase. Multiple decls is often preferred for the reasons I mentioned earlier, which benefit the browser debugging process, but also for other reasons, such as being able to move a declaration up and down as necessary, without being concerned with leaving a missing comma or ending the decl block on a comma instead of a ;. This PR (JSHint) actually found an issue that would have been avoided by not relying on comma separation of declarations. If I remember right, something like:

var a = 'b'
    c = 'd';

I think there are lots of reasons to support using multiple var decls, but I'm not sure what's in the CONs column for multiple delcs (or the PROs column for comma-separated). You mentioned readability, but as a 90% js dev working in many codebases over the last few years with many different codestyles, multiple var decls doesn't make anything less readable to me, and I don't think others will be slowed down a bit. Again, they're equally common to see. Since we have doc blocks and a hard 80char limit, those are the two reasons I think multiple var decls makes sense for this codebase.

OTOH, could you add yourself to CONTRIBUTORS file?

Yes!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

stephenplusplus added 2 commits August 5, 2014 13:34
@stephenplusplus
add editorconfig & jshint.
547e73c
@stephenplusplus
re-tweaks.
74b66cf
stephenplusplus
stephenplusplus reviewed Aug 5, 2014
View reviewed changes
Comment thread package.json

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rakyll pushed a commit that referenced this pull request Aug 5, 2014
Burcu Dogan
Merge pull request #92 from stephenplusplus/tools
f54daea
add editorconfig & jshint.
@rakyll
rakyll merged commit f54daea into googleapis:master Aug 5, 2014
@rakyll

rakyll commented Aug 5, 2014

Copy link
Copy Markdown
Contributor

Thanks much!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Aug 5, 2014

Copy link
Copy Markdown
Contributor Author

Yay!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jgeewax jgeewax added the testing label Feb 2, 2015
@jgeewax jgeewax modified the milestone: M1: core, datastore & storage Feb 2, 2015
@sofisl sofisl mentioned this pull request Sep 13, 2023
migrate code from googleapis/nodejs-automl #4655
Closed
4 tasks
sofisl pushed a commit that referenced this pull request Sep 13, 2023
@JustinBeckwith
chore: update license file (#92)
8ba967d
This was referenced Sep 14, 2023
migrate code from googleapis/nodejs-automl #4656
Merged
migrate code from googleapis/nodejs-dns #4657
Merged
This was referenced Nov 28, 2023
[Snyk] Fix for 21 vulnerabilities takeratta/google-cloud-node#28
Open
[Snyk] Fix for 1 vulnerabilities takeratta/google-cloud-node#46
Open
This was referenced Jan 14, 2026
migrate code from googleapis/nodejs-logging-bunyan #6991
Closed
migrate code from googleapis/nodejs-logging-bunyan #6995
Closed
@GautamSharda GautamSharda mentioned this pull request Jan 20, 2026
chore: migrate code from googleapis/nodejs-error-reporting #7019
Closed
4 tasks
@miguelvelezsa miguelvelezsa mentioned this pull request Jan 21, 2026
migrate code from googleapis/nodejs-logging-bunyan #7021
Closed
@miguelvelezsa miguelvelezsa mentioned this pull request Jan 28, 2026
migrate code from googleapis/nodejs-datastore #7053
Closed
This was referenced Feb 4, 2026
migrate code from googleapis/nodejs-logging-bunyan #7136
Closed
migrate code from googleapis/nodejs-logging-bunyan #7137
Closed
migrate code from googleapis/nodejs-logging-bunyan #7138
Merged
migrate code from googleapis/nodejs-datastore #7148
Closed
@GautamSharda GautamSharda mentioned this pull request Feb 5, 2026
migrate code from googleapis/nodejs-error-reporting #7169
Closed
4 tasks
@sofisl sofisl mentioned this pull request Feb 17, 2026
migrate code from googleapis/nodejs-datastore #7263
Merged
4 tasks
This was referenced Feb 23, 2026
migrate code from googleapis/nodejs-error-reporting #7294
Closed
migrate code from googleapis/nodejs-bigquery-storage #7306
Closed
migrate code from googleapis/nodejs-error-reporting #7308
Merged
This was referenced Feb 26, 2026
migrate code from googleapis/nodejs-firestore #7311
Closed
migrate code from googleapis/nodejs-firestore #7410
Merged
@GautamSharda GautamSharda mentioned this pull request Mar 5, 2026
migrate code from googleapis/nodejs-bigquery-storage #7496
Merged
4 tasks
@codyoss codyoss mentioned this pull request Mar 5, 2026
migrate code from googleapis/nodejs-projectify #7511
Merged
@GautamSharda GautamSharda mentioned this pull request Mar 5, 2026
migrate code from googleapis/nodejs-logging #7514
Merged
4 tasks
@codyoss codyoss mentioned this pull request Mar 9, 2026
migrate code from googleapis/nodejs-paginator #7536
Closed
@meltsufin meltsufin mentioned this pull request Mar 10, 2026
chore: migrate code from googleapis/nodejs-logging #7550
Merged
@codyoss codyoss mentioned this pull request Mar 11, 2026
migrate code from googleapis/nodejs-paginator #7590
Merged
@GautamSharda GautamSharda mentioned this pull request Mar 11, 2026
migrate code from googleapis/nodejs-pubsub #7592
Merged
4 tasks
@codyoss codyoss mentioned this pull request Mar 12, 2026
migrate code from googleapis/nodejs-precise-date #7594
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@stephenplusplus @rakyll @jgeewax
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.