From c07a3fe2084f34647e6c8cc82ac3f0277e32348f Mon Sep 17 00:00:00 2001 From: William Chargin Date: Mon, 11 Nov 2019 12:47:26 -0800 Subject: [PATCH] deps: upgrade `prettier@1.19.1` (#1439) Summary: Most changes due to . Generated with `yarn add prettier@1.19.1 && yarn prettify`. Test Plan: Running `yarn test` suffices. wchargin-branch: prettier-v1.19.1 --- package.json | 2 +- .../timeline/timelinePagerank.test.js | 5 ++- src/core/attribution/markovChain.test.js | 27 +++++++++++--- src/core/graph.test.js | 10 ++++-- src/explorer/legacy/pagerankTable/Node.js | 6 +++- src/graphql/mirror.js | 7 ++-- src/graphql/mirror.test.js | 5 ++- src/plugins/discourse/mirror.test.js | 7 +++- src/plugins/github/parseReferences.test.js | 6 ++-- src/plugins/github/relationalView.js | 8 +++-- src/plugins/github/relationalView.test.js | 36 +++++++++++++++---- yarn.lock | 8 ++--- 12 files changed, 96 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 482fe23..2c0b751 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "flow-bin": "^0.111.0", "jest": "^24.8.0", "jest-fetch-mock": "^2.1.2", - "prettier": "1.18.2", + "prettier": "1.19.1", "raf": "3.4.1", "react-dev-utils": "^5.0.0", "static-site-generator-webpack-plugin": "^3.4.1", diff --git a/src/analysis/timeline/timelinePagerank.test.js b/src/analysis/timeline/timelinePagerank.test.js index 3e1b5e4..a284071 100644 --- a/src/analysis/timeline/timelinePagerank.test.js +++ b/src/analysis/timeline/timelinePagerank.test.js @@ -25,7 +25,10 @@ describe("src/analysis/timeline/timelinePagerank", () => { const expected = [ new Map([[foo.address, 2]]), new Map([[foo.address, 1]]), - new Map([[foo.address, 0.5], [bar.address, 0.5]]), + new Map([ + [foo.address, 0.5], + [bar.address, 0.5], + ]), ]; expect(weights).toEqual(expected); }); diff --git a/src/core/attribution/markovChain.test.js b/src/core/attribution/markovChain.test.js index 768e398..23fa68e 100644 --- a/src/core/attribution/markovChain.test.js +++ b/src/core/attribution/markovChain.test.js @@ -34,7 +34,11 @@ describe("core/attribution/markovChain", () => { describe("sparseMarkovChainFromTransitionMatrix", () => { it("works for a simple matrix", () => { - const matrix = [[1, 0, 0], [0.25, 0, 0.75], [0.25, 0.75, 0]]; + const matrix = [ + [1, 0, 0], + [0.25, 0, 0.75], + [0.25, 0.75, 0], + ]; const chain = sparseMarkovChainFromTransitionMatrix(matrix); const expected = [ { @@ -80,7 +84,11 @@ describe("core/attribution/markovChain", () => { }); it("rejects a matrix with negative entries", () => { - const matrix = [[1, 0, 0], [-0.5, 0.75, 0.75], [0, 0, 1]]; + const matrix = [ + [1, 0, 0], + [-0.5, 0.75, 0.75], + [0, 0, 1], + ]; expect(() => sparseMarkovChainFromTransitionMatrix(matrix)).toThrow( /positive real.*-0.5/ ); @@ -101,7 +109,10 @@ describe("core/attribution/markovChain", () => { }); it("rejects a non-stochastic matrix", () => { - const matrix = [[1, 0], [0.125, 0.625]]; + const matrix = [ + [1, 0], + [0.125, 0.625], + ]; expect(() => sparseMarkovChainFromTransitionMatrix(matrix)).toThrow( /sums to 0.75/ ); @@ -338,7 +349,10 @@ describe("core/attribution/markovChain", () => { }); it("finds the stationary distribution of a periodic chain", async () => { - const chain = sparseMarkovChainFromTransitionMatrix([[0, 1], [1, 0]]); + const chain = sparseMarkovChainFromTransitionMatrix([ + [0, 1], + [1, 0], + ]); const params: PagerankParams = { chain, alpha: 0, @@ -359,7 +373,10 @@ describe("core/attribution/markovChain", () => { }); it("returns initial distribution if maxIterations===0", async () => { - const chain = sparseMarkovChainFromTransitionMatrix([[0, 1], [0, 1]]); + const chain = sparseMarkovChainFromTransitionMatrix([ + [0, 1], + [0, 1], + ]); const params: PagerankParams = { chain, alpha: 0, diff --git a/src/core/graph.test.js b/src/core/graph.test.js index fc1f5a3..d64b10f 100644 --- a/src/core/graph.test.js +++ b/src/core/graph.test.js @@ -994,7 +994,10 @@ describe("core/graph", () => { Direction.IN, [], [], - [{node: loop, edge: loop_loop}, {node: foo, edge: foo_loop}] + [ + {node: loop, edge: loop_loop}, + {node: foo, edge: foo_loop}, + ] ); }); it("OUT", () => { @@ -1076,7 +1079,10 @@ describe("core/graph", () => { it("works for a proper prefix match", () => { edgeExpectNeighbors( ["foo"], - [{node: foo, edge: foo_loop}, {node: foo, edge: loop_foo}] + [ + {node: foo, edge: foo_loop}, + {node: foo, edge: loop_foo}, + ] ); }); it("works when there are no matching edges", () => { diff --git a/src/explorer/legacy/pagerankTable/Node.js b/src/explorer/legacy/pagerankTable/Node.js index c5a0179..beb2118 100644 --- a/src/explorer/legacy/pagerankTable/Node.js +++ b/src/explorer/legacy/pagerankTable/Node.js @@ -29,7 +29,11 @@ export class NodeRowList extends React.PureComponent { const {pnd, maxEntriesPerList} = sharedProps; return ( - {sortBy(nodes, (n) => -NullUtil.get(pnd.get(n)).score, (n) => n) + {sortBy( + nodes, + (n) => -NullUtil.get(pnd.get(n)).score, + (n) => n + ) .slice(0, maxEntriesPerList) .map((node) => ( - b.inlineFragment(clause, [b.field("id")]) + ...this._schemaInfo.unionTypes[ + typename + ].clauses.map((clause: Schema.Typename) => + b.inlineFragment(clause, [b.field("id")]) ), ]; // istanbul ignore next diff --git a/src/graphql/mirror.test.js b/src/graphql/mirror.test.js index f5dc50d..0667c4c 100644 --- a/src/graphql/mirror.test.js +++ b/src/graphql/mirror.test.js @@ -2195,7 +2195,10 @@ describe("graphql/mirror", () => { "ORDER BY o_id ASC" ) .all() - ).toEqual([{o_id: "dos", p_rowid: null}, {o_id: "uno", p_rowid: null}]); + ).toEqual([ + {o_id: "dos", p_rowid: null}, + {o_id: "uno", p_rowid: null}, + ]); expect( db .prepare("SELECT * FROM links ORDER BY parent_id ASC") diff --git a/src/plugins/discourse/mirror.test.js b/src/plugins/discourse/mirror.test.js index 572f52d..8ad2c7b 100644 --- a/src/plugins/discourse/mirror.test.js +++ b/src/plugins/discourse/mirror.test.js @@ -231,7 +231,12 @@ describe("plugins/discourse/mirror", () => { }); function expectLikesSorted(as, bs) { - const s = (ls) => sortBy(ls, (x) => x.username, (x) => x.postId); + const s = (ls) => + sortBy( + ls, + (x) => x.username, + (x) => x.postId + ); expect(s(as)).toEqual(s(bs)); } diff --git a/src/plugins/github/parseReferences.test.js b/src/plugins/github/parseReferences.test.js index 4944cf5..089aeaa 100644 --- a/src/plugins/github/parseReferences.test.js +++ b/src/plugins/github/parseReferences.test.js @@ -82,9 +82,9 @@ describe("plugins/github/parseReferences", () => { ]); }); it("a link with surrounding context", () => { - expect(parseReferences("please see sourcecred/example_.repo#12")).toEqual( - [{refType: "BASIC", ref: repoRef}] - ); + expect( + parseReferences("please see sourcecred/example_.repo#12") + ).toEqual([{refType: "BASIC", ref: repoRef}]); }); }); diff --git a/src/plugins/github/relationalView.js b/src/plugins/github/relationalView.js index cd58db5..9d7122c 100644 --- a/src/plugins/github/relationalView.js +++ b/src/plugins/github/relationalView.js @@ -295,9 +295,11 @@ export class RelationalView { issues: expectAllNonNull(json, "issues", json.issues).map((x) => this._addIssue(address, x) ), - pulls: expectAllNonNull(json, "pullRequests", json.pullRequests).map( - (x) => this._addPull(address, x) - ), + pulls: expectAllNonNull( + json, + "pullRequests", + json.pullRequests + ).map((x) => this._addPull(address, x)), timestampMs: +new Date(json.createdAt), }; const raw = N.toRaw(address); diff --git a/src/plugins/github/relationalView.test.js b/src/plugins/github/relationalView.test.js index 0504448..6231a54 100644 --- a/src/plugins/github/relationalView.test.js +++ b/src/plugins/github/relationalView.test.js @@ -57,12 +57,36 @@ describe("plugins/github/relationalView", () => { }); }); } - hasEntityMethods("repos", () => view.repos(), (x) => view.repo(x)); - hasEntityMethods("issues", () => view.issues(), (x) => view.issue(x)); - hasEntityMethods("pulls", () => view.pulls(), (x) => view.pull(x)); - hasEntityMethods("reviews", () => view.reviews(), (x) => view.review(x)); - hasEntityMethods("comments", () => view.comments(), (x) => view.comment(x)); - hasEntityMethods("commits", () => view.commits(), (x) => view.commit(x)); + hasEntityMethods( + "repos", + () => view.repos(), + (x) => view.repo(x) + ); + hasEntityMethods( + "issues", + () => view.issues(), + (x) => view.issue(x) + ); + hasEntityMethods( + "pulls", + () => view.pulls(), + (x) => view.pull(x) + ); + hasEntityMethods( + "reviews", + () => view.reviews(), + (x) => view.review(x) + ); + hasEntityMethods( + "comments", + () => view.comments(), + (x) => view.comment(x) + ); + hasEntityMethods( + "commits", + () => view.commits(), + (x) => view.commit(x) + ); hasEntityMethods( "userlikes", () => view.userlikes(), diff --git a/yarn.lock b/yarn.lock index 33d22a4..8ef274b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6740,10 +6740,10 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prettier@1.18.2: - version "1.18.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" - integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== +prettier@1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== pretty-format@^24.8.0: version "24.8.0"