Skip to content
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

add editorconfig & jshint. #92

Merged
merged 2 commits into from
Aug 5, 2014
Merged

Conversation

stephenplusplus
Copy link
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.

"test": "node_modules/mocha/bin/_mocha --reporter spec",
"regression-test": "node_modules/mocha/bin/_mocha --reporter spec --timeout 10000 regression/*",
"cover": "node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- --timeout 10000 test/* regression/*"
"test": "jshint lib/**/*.js test/*.js && mocha --reporter spec",

This comment was marked as spam.

@rakyll
Copy link
Contributor

rakyll commented Aug 4, 2014

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

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

Combing over everything now 💇

@rakyll
Copy link
Contributor

rakyll commented Aug 5, 2014

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

@stephenplusplus
Copy link
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 :).

@rakyll
Copy link
Contributor

rakyll commented Aug 5, 2014

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

@stephenplusplus
Copy link
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.

@stephenplusplus
Copy link
Contributor Author

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

it('should support boolean, integer, double, string, entity and list values', function(done) {
it(
'should support boolean, integer, double, string, entity and list values',
function(done) {

This comment was marked as spam.

This comment was marked as spam.

@rakyll
Copy link
Contributor

rakyll commented Aug 5, 2014

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.

@rakyll
Copy link
Contributor

rakyll commented Aug 5, 2014

OTOH, could you add yourself to CONTRIBUTORS file?

@stephenplusplus
Copy link
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!

},
{
"name": "Stephen Sawchuk",
"email": "sawchuk@gmail.com"

This comment was marked as spam.

This comment was marked as spam.

rakyll pushed a commit that referenced this pull request Aug 5, 2014
add editorconfig & jshint.
@rakyll rakyll merged commit f54daea into googleapis:master Aug 5, 2014
@rakyll
Copy link
Contributor

rakyll commented Aug 5, 2014

Thanks much!

@stephenplusplus
Copy link
Contributor Author

Yay!

@jgeewax jgeewax added the testing label Feb 2, 2015
@jgeewax jgeewax modified the milestone: M1: core, datastore & storage Feb 2, 2015
sofisl pushed a commit that referenced this pull request Nov 12, 2022
samples: pull in latest typeless bot, clean up some comments

Source-Link: https://togithub.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e
sofisl pushed a commit that referenced this pull request Nov 12, 2022
🤖 I have created a release *beep* *boop*
---


## [2.2.0](https://togithub.com/googleapis/nodejs-filestore/compare/v2.1.0...v2.2.0) (2022-11-11)


### Features

* New APIs added to reflect updates to the filestore service ([#93](https://togithub.com/googleapis/nodejs-filestore/issues/93)) ([619e7f1](https://togithub.com/googleapis/nodejs-filestore/commit/619e7f142a621303afc58b38261711d33584ea5f))


### Bug Fixes

* Allow passing gax instance to client constructor ([#82](https://togithub.com/googleapis/nodejs-filestore/issues/82)) ([37a928b](https://togithub.com/googleapis/nodejs-filestore/commit/37a928bf3c049d0cd66e4efa5d41717fa5ff9a28))
* Better support for fallback mode ([#77](https://togithub.com/googleapis/nodejs-filestore/issues/77)) ([c339f3f](https://togithub.com/googleapis/nodejs-filestore/commit/c339f3f49c0a10fd2d42a64de20a9d2f06ae061e))
* Change import long to require ([#78](https://togithub.com/googleapis/nodejs-filestore/issues/78)) ([c9ce9d1](https://togithub.com/googleapis/nodejs-filestore/commit/c9ce9d147dd1cc6f99b63e53af9cf75c1999dc90))
* **deps:** Use google-gax v3.5.2 ([#89](https://togithub.com/googleapis/nodejs-filestore/issues/89)) ([5fde972](https://togithub.com/googleapis/nodejs-filestore/commit/5fde972b08be1106b42bce644f1282f690b93677))
* Do not import the whole google-gax from proto JS ([#1553](https://togithub.com/googleapis/nodejs-filestore/issues/1553)) ([#81](https://togithub.com/googleapis/nodejs-filestore/issues/81)) ([e0b4ac4](https://togithub.com/googleapis/nodejs-filestore/commit/e0b4ac42145ad648f3ae5f6c77917a2dd94d5192))
* Preserve default values in x-goog-request-params header ([#83](https://togithub.com/googleapis/nodejs-filestore/issues/83)) ([2cd3cb0](https://togithub.com/googleapis/nodejs-filestore/commit/2cd3cb022d1cb11fa3d04dbda58fd32de995c462))
* Regenerated protos JS and TS definitions ([#92](https://togithub.com/googleapis/nodejs-filestore/issues/92)) ([cb324b9](https://togithub.com/googleapis/nodejs-filestore/commit/cb324b9f3f93eaea7228386e5bf406ed570bafcc))
* Remove pip install statements ([#1546](https://togithub.com/googleapis/nodejs-filestore/issues/1546)) ([#80](https://togithub.com/googleapis/nodejs-filestore/issues/80)) ([73de8d6](https://togithub.com/googleapis/nodejs-filestore/commit/73de8d63b8b221df09c193400d1028cf3924a6ae))
* use google-gax v3.3.0 ([e0b4ac4](https://togithub.com/googleapis/nodejs-filestore/commit/e0b4ac42145ad648f3ae5f6c77917a2dd94d5192))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
sofisl pushed a commit that referenced this pull request Nov 16, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^11.0.0` -> `^12.0.0`](https://renovatebot.com/diffs/npm/sinon/11.1.2/12.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/compatibility-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/confidence-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>sinonjs/sinon</summary>

### [`v12.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGES.md#&#8203;1201)

[Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.0...v12.0.1)

-   [`3f598221`](https://togithub.com/sinonjs/sinon/commit/3f598221045904681f2b3b3ba1df617ed5e230e3)
    Fix issue with npm unlink for npm version > 6 (Carl-Erik Kopseng)
    > 'npm unlink' would implicitly unlink the current dir
    > until version 7, which requires an argument
-   [`51417a38`](https://togithub.com/sinonjs/sinon/commit/51417a38111eeeb7cd14338bfb762cc2df487e1b)
    Fix bundling of cjs module ([#&#8203;2412](https://togithub.com/sinonjs/sinon/issues/2412)) (Julian Grinblat)
    > -   Fix bundling of cjs module
    >
    > -   Run prettier

*Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2021-11-04.*

#### 12.0.0

### [`v12.0.0`](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)

[Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)

</details>

---

### Configuration

📅 **Schedule**: "after 9am and before 3pm" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-managed-identities).
sofisl pushed a commit that referenced this pull request Nov 16, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^11.0.0` -> `^12.0.0`](https://renovatebot.com/diffs/npm/sinon/11.1.2/12.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/compatibility-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/confidence-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>sinonjs/sinon</summary>

### [`v12.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGES.md#&#8203;1201)

[Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.0...v12.0.1)

-   [`3f598221`](https://togithub.com/sinonjs/sinon/commit/3f598221045904681f2b3b3ba1df617ed5e230e3)
    Fix issue with npm unlink for npm version > 6 (Carl-Erik Kopseng)
    > 'npm unlink' would implicitly unlink the current dir
    > until version 7, which requires an argument
-   [`51417a38`](https://togithub.com/sinonjs/sinon/commit/51417a38111eeeb7cd14338bfb762cc2df487e1b)
    Fix bundling of cjs module ([#&#8203;2412](https://togithub.com/sinonjs/sinon/issues/2412)) (Julian Grinblat)
    > -   Fix bundling of cjs module
    >
    > -   Run prettier

*Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2021-11-04.*

#### 12.0.0

### [`v12.0.0`](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)

[Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)

</details>

---

### Configuration

📅 **Schedule**: "after 9am and before 3pm" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-network-connectivity).
sofisl pushed a commit that referenced this pull request Nov 16, 2022
sofisl pushed a commit that referenced this pull request Nov 16, 2022
sofisl pushed a commit that referenced this pull request Nov 17, 2022
sofisl pushed a commit that referenced this pull request Nov 30, 2022
sofisl pushed a commit that referenced this pull request Jan 10, 2023
sofisl pushed a commit that referenced this pull request Jan 17, 2023
sofisl pushed a commit that referenced this pull request Jan 26, 2023
…d aiplatform API Vizier service (#92)

Committer: @dizcology
PiperOrigin-RevId: 363921711

Source-Author: Google APIs <noreply@google.com>
Source-Date: Fri Mar 19 10:37:18 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 4ea5a2764a08f86676d0e853dbb01c4e9868a22b
Source-Link: googleapis/googleapis@4ea5a27

Co-authored-by: Benjamin E. Coe <bencoe@google.com>
sofisl pushed a commit that referenced this pull request Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants