Skip to content

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.

package.json Outdated

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! :)

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!

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 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 <[email protected]>
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 <[email protected]>
sofisl pushed a commit that referenced this pull request Sep 13, 2023
GautamSharda pushed a commit that referenced this pull request Jan 14, 2026
The sample code had a compilation error.
GautamSharda pushed a commit that referenced this pull request Jan 15, 2026
The sample code had a compilation error.
miguelvelezsa pushed a commit that referenced this pull request Jan 28, 2026
* chore: lock files maintenance

* chore: lock files maintenance
miguelvelezsa pushed a commit that referenced this pull request Jan 29, 2026
chore(deps): update dependency mocha to v6

This PR contains the following updates:

| Package | Type | Update | Change | References |
|---|---|---|---|---|
| mocha | devDependencies | major | `^5.2.0` -> `^6.0.0` | [homepage](https://mochajs.org/), [source](https://togithub.com/mochajs/mocha) |

---

### Release Notes

<details>
<summary>mochajs/mocha</summary>

### [`v6.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#&#8203;600--2019-02-18)

[Compare Source](https://togithub.com/mochajs/mocha/compare/v5.2.0...v6.0.0)

#### 🎉 Enhancements

-   [#&#8203;3726](https://togithub.com/mochajs/mocha/issues/3726): Add ability to unload files from `require` cache ([**@&#8203;plroebuck**](https://togithub.com/plroebuck))

#### 🐛 Fixes

-   [#&#8203;3737](https://togithub.com/mochajs/mocha/issues/3737): Fix falsy values from options globals ([**@&#8203;plroebuck**](https://togithub.com/plroebuck))
-   [#&#8203;3707](https://togithub.com/mochajs/mocha/issues/3707): Fix encapsulation issues for `Suite#_onlyTests` and `Suite#_onlySuites` ([**@&#8203;vkarpov15**](https://togithub.com/vkarpov15))
-   [#&#8203;3711](https://togithub.com/mochajs/mocha/issues/3711): Fix diagnostic messages dealing with plurality and markup of output ([**@&#8203;plroebuck**](https://togithub.com/plroebuck))
-   [#&#8203;3723](https://togithub.com/mochajs/mocha/issues/3723): Fix "reporter-option" to allow comma-separated options ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3722](https://togithub.com/mochajs/mocha/issues/3722): Fix code quality and performance of `lookupFiles` and `files` ([**@&#8203;plroebuck**](https://togithub.com/plroebuck))
-   [#&#8203;3650](https://togithub.com/mochajs/mocha/issues/3650), [#&#8203;3654](https://togithub.com/mochajs/mocha/issues/3654): Fix noisy error message when no files found ([**@&#8203;craigtaub**](https://togithub.com/craigtaub))
-   [#&#8203;3632](https://togithub.com/mochajs/mocha/issues/3632): Tests having an empty title are no longer confused with the "root" suite ([**@&#8203;juergba**](https://togithub.com/juergba))
-   [#&#8203;3666](https://togithub.com/mochajs/mocha/issues/3666): Fix missing error codes ([**@&#8203;vkarpov15**](https://togithub.com/vkarpov15))
-   [#&#8203;3684](https://togithub.com/mochajs/mocha/issues/3684): Fix exiting problem in Node.js v11.7.0+ ([**@&#8203;addaleax**](https://togithub.com/addaleax))
-   [#&#8203;3691](https://togithub.com/mochajs/mocha/issues/3691): Fix `--delay` (and other boolean options) not working in all cases ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3692](https://togithub.com/mochajs/mocha/issues/3692): Fix invalid command-line argument usage not causing actual errors ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3698](https://togithub.com/mochajs/mocha/issues/3698), [#&#8203;3699](https://togithub.com/mochajs/mocha/issues/3699): Fix debug-related Node.js options not working in all cases ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3700](https://togithub.com/mochajs/mocha/issues/3700): Growl notifications now show the correct number of tests run ([**@&#8203;outsideris**](https://togithub.com/outsideris))
-   [#&#8203;3686](https://togithub.com/mochajs/mocha/issues/3686): Avoid potential ReDoS when diffing large objects ([**@&#8203;cyjake**](https://togithub.com/cyjake))
-   [#&#8203;3715](https://togithub.com/mochajs/mocha/issues/3715): Fix incorrect order of emitted events when used programmatically ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3706](https://togithub.com/mochajs/mocha/issues/3706): Fix regression wherein `--reporter-option`/`--reporter-options` did not support comma-separated key/value pairs ([**@&#8203;boneskull**](https://togithub.com/boneskull))

#### 📖 Documentation

-   [#&#8203;3652](https://togithub.com/mochajs/mocha/issues/3652): Switch from Jekyll to Eleventy ([**@&#8203;Munter**](https://togithub.com/Munter))

#### 🔩 Other

-   [#&#8203;3677](https://togithub.com/mochajs/mocha/issues/3677): Add error objects for createUnsupportedError and createInvalidExceptionError ([**@&#8203;boneskull**](https://togithub.com/boneskull))
-   [#&#8203;3733](https://togithub.com/mochajs/mocha/issues/3733): Removed unnecessary processing in post-processing hook ([**@&#8203;wanseob**](https://togithub.com/wanseob))
-   [#&#8203;3730](https://togithub.com/mochajs/mocha/issues/3730): Update nyc to latest version ([**@&#8203;coreyfarrell**](https://togithub.com/coreyfarrell))
-   [#&#8203;3648](https://togithub.com/mochajs/mocha/issues/3648), [#&#8203;3680](https://togithub.com/mochajs/mocha/issues/3680): Fixes to support latest versions of [unexpected](https://npm.im/unexpected) and [unexpected-sinon](https://npm.im/unexpected-sinon) ([**@&#8203;sunesimonsen**](https://togithub.com/sunesimonsen))
-   [#&#8203;3638](https://togithub.com/mochajs/mocha/issues/3638): Add meta tag to site ([**@&#8203;MartijnCuppens**](https://togithub.com/MartijnCuppens))
-   [#&#8203;3653](https://togithub.com/mochajs/mocha/issues/3653): Fix parts of test suite failing to run on Windows ([**@&#8203;boneskull**](https://togithub.com/boneskull))

</details>

---

### Renovate configuration

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

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

:recycle: **Rebasing**: Whenever PR is stale, or if you modify the PR title to begin with "`rebase!`".

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

---

 - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-promisify).

#92 automerged by dpebot
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