From 1a2c4e663e7665e623de88bc57063920f20a02f8 Mon Sep 17 00:00:00 2001 From: Ika Date: Wed, 18 Jul 2018 09:38:26 +0800 Subject: [PATCH] chore: use pre-release version number on master (#4855) * chore: use pre-release version number on master * docs: tweak comment --- package.json | 2 +- src/main/support.js | 4 +- .../markdown/__snapshots__/jsfmt.spec.js.snap | 28 +++++++------- .../__tests__/__snapshots__/schema.js.snap | 6 +++ .../__snapshots__/support-info.js.snap | 38 +++++++++++++++++-- 5 files changed, 58 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 345cb504..bfe2ed9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prettier", - "version": "1.13.7", + "version": "1.14.0-dev", "description": "Prettier is an opinionated code formatter", "bin": { "prettier": "./bin/prettier.js" diff --git a/src/main/support.js b/src/main/support.js index facf3def..3825df25 100644 --- a/src/main/support.js +++ b/src/main/support.js @@ -17,7 +17,9 @@ function getSupportInfo(version, opts) { ); if (!version) { - version = currentVersion; + // pre-release version is smaller than the normal version in semver, + // we need to treat it as the normal one so as to test new features. + version = currentVersion.split("-", 1)[0]; } const plugins = opts.plugins; diff --git a/tests/markdown/__snapshots__/jsfmt.spec.js.snap b/tests/markdown/__snapshots__/jsfmt.spec.js.snap index 6a2048ce..a889b7a7 100644 --- a/tests/markdown/__snapshots__/jsfmt.spec.js.snap +++ b/tests/markdown/__snapshots__/jsfmt.spec.js.snap @@ -1392,10 +1392,10 @@ how you can configure lint-staged. Copy the following config into your \`.pre-commit-config.yaml\` file: \`\`\`yaml - - repo: https://github.com/prettier/prettier - sha: '' # Use the sha or tag you want to point at - hooks: - - id: prettier +- repo: https://github.com/prettier/prettier + sha: "" # Use the sha or tag you want to point at + hooks: + - id: prettier \`\`\` Find more info from [here](https://pre-commit.com). @@ -1801,9 +1801,9 @@ YAML: \`\`\`yaml semi: false overrides: -- files: "*.test.js" - options: - semi: true + - files: "*.test.js" + options: + semi: true \`\`\` \`files\` is required for each override, and may be a string or array of strings. @@ -3363,10 +3363,10 @@ how you can configure lint-staged. Copy the following config into your \`.pre-commit-config.yaml\` file: \`\`\`yaml - - repo: https://github.com/prettier/prettier - sha: '' # Use the sha or tag you want to point at - hooks: - - id: prettier +- repo: https://github.com/prettier/prettier + sha: '' # Use the sha or tag you want to point at + hooks: + - id: prettier \`\`\` Find more info from [here](https://pre-commit.com). @@ -3772,9 +3772,9 @@ YAML: \`\`\`yaml semi: false overrides: -- files: "*.test.js" - options: - semi: true + - files: '*.test.js' + options: + semi: true \`\`\` \`files\` is required for each override, and may be a string or array of strings. diff --git a/tests_integration/__tests__/__snapshots__/schema.js.snap b/tests_integration/__tests__/__snapshots__/schema.js.snap index 89342bd5..dc14a1e5 100644 --- a/tests_integration/__tests__/__snapshots__/schema.js.snap +++ b/tests_integration/__tests__/__snapshots__/schema.js.snap @@ -134,6 +134,12 @@ This option cannot be used with --range-start and --range-end.", "vue", ], }, + Object { + "description": "YAML", + "enum": Array [ + "yaml", + ], + }, ], }, "pluginSearchDirs": Object { diff --git a/tests_integration/__tests__/__snapshots__/support-info.js.snap b/tests_integration/__tests__/__snapshots__/support-info.js.snap index 6c666eed..c6319c47 100644 --- a/tests_integration/__tests__/__snapshots__/support-info.js.snap +++ b/tests_integration/__tests__/__snapshots__/support-info.js.snap @@ -429,7 +429,7 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = ` \\"flow\\", ], \\"JavaScript\\": Array [ -@@ -37,12 +43,23 @@ +@@ -37,12 +43,26 @@ \\"scss\\", ], \\"TypeScript\\": Array [ @@ -437,6 +437,9 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = ` ], + \\"Vue\\": Array [ + \\"vue\\", ++ ], ++ \\"YAML\\": Array [ ++ \\"yaml\\", + ], }, \\"options\\": Object { @@ -453,7 +456,7 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = ` \\"type\\": \\"boolean\\", }, \\"cursorOffset\\": Object { -@@ -73,16 +90,27 @@ +@@ -73,16 +93,28 @@ \\"typescript\\", \\"css\\", \\"less\\", @@ -464,6 +467,7 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = ` \\"graphql\\", \\"markdown\\", + \\"vue\\", ++ \\"yaml\\", ], - \\"default\\": \\"babylon\\", + \\"default\\": undefined, @@ -482,7 +486,7 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = ` \\"range\\": Object { \\"end\\": Infinity, \\"start\\": 0, -@@ -90,14 +118,15 @@ +@@ -90,14 +122,15 @@ }, \\"type\\": \\"int\\", }, @@ -786,6 +790,31 @@ exports[`CLI --support-info (stdout) 1`] = ` \\"tmScope\\": \\"text.html.vue\\", \\"type\\": \\"markup\\", \\"vscodeLanguageIds\\": [\\"vue\\"] + }, + { + \\"aceMode\\": \\"yaml\\", + \\"aliases\\": [\\"yml\\"], + \\"codemirrorMimeType\\": \\"text/x-yaml\\", + \\"codemirrorMode\\": \\"yaml\\", + \\"extensions\\": [ + \\".yml\\", + \\".mir\\", + \\".reek\\", + \\".rviz\\", + \\".sublime-syntax\\", + \\".syntax\\", + \\".yaml\\", + \\".yaml-tmlanguage\\", + \\".yml.mysql\\" + ], + \\"filenames\\": [\\".clang-format\\", \\".clang-tidy\\", \\".gemrc\\", \\"glide.lock\\"], + \\"linguistLanguageId\\": 407, + \\"name\\": \\"YAML\\", + \\"parsers\\": [\\"yaml\\"], + \\"since\\": \\"1.14.0\\", + \\"tmScope\\": \\"source.yaml\\", + \\"type\\": \\"data\\", + \\"vscodeLanguageIds\\": [\\"yaml\\"] } ], \\"options\\": [ @@ -876,7 +905,8 @@ exports[`CLI --support-info (stdout) 1`] = ` }, { \\"description\\": \\"GraphQL\\", \\"since\\": \\"1.5.0\\", \\"value\\": \\"graphql\\" }, { \\"description\\": \\"Markdown\\", \\"since\\": \\"1.8.0\\", \\"value\\": \\"markdown\\" }, - { \\"description\\": \\"Vue\\", \\"since\\": \\"1.10.0\\", \\"value\\": \\"vue\\" } + { \\"description\\": \\"Vue\\", \\"since\\": \\"1.10.0\\", \\"value\\": \\"vue\\" }, + { \\"description\\": \\"YAML\\", \\"since\\": \\"1.14.0\\", \\"value\\": \\"yaml\\" } ], \\"description\\": \\"Which parser to use.\\", \\"name\\": \\"parser\\",