From 46d373f4bd0e4c3b46838912cd4c1b667ac557c3 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Sat, 10 Sep 2022 17:24:54 -0700 Subject: [PATCH] [#103] Specify --parser in Prettier (#107) Closes #103 --- CHANGELOG.md | 11 +++++ apheleia.el | 40 ++++++++++++++----- test/formatters/installers/prettier-css.bash | 1 + .../installers/prettier-graphql.bash | 1 + test/formatters/installers/prettier-html.bash | 1 + .../installers/prettier-javascript.bash | 1 + test/formatters/installers/prettier-json.bash | 1 + .../installers/prettier-markdown.bash | 1 + test/formatters/installers/prettier-ruby.bash | 15 +++++++ test/formatters/installers/prettier-scss.bash | 1 + .../installers/prettier-typescript.bash | 1 + test/formatters/installers/prettier-yaml.bash | 1 + .../formatters/samplecode/prettier-css/in.css | 13 ++++++ .../samplecode/prettier-css/out.css | 6 +++ .../samplecode/prettier-graphql/in.graphql | 1 + .../samplecode/prettier-graphql/out.graphql | 6 +++ .../samplecode/prettier-html/in.html | 1 + .../samplecode/prettier-html/out.html | 5 +++ .../samplecode/prettier-javascript/in.js | 4 ++ .../samplecode/prettier-javascript/out.js | 10 +++++ .../samplecode/prettier-json/in.json | 1 + .../samplecode/prettier-json/out.json | 19 +++++++++ .../samplecode/prettier-markdown/in.md | 4 ++ .../samplecode/prettier-markdown/out.md | 4 ++ .../formatters/samplecode/prettier-ruby/in.rb | 13 ++++++ .../samplecode/prettier-ruby/out.rb | 18 +++++++++ .../samplecode/prettier-scss/in.scss | 1 + .../samplecode/prettier-scss/out.scss | 9 +++++ .../samplecode/prettier-typescript/in.ts | 1 + .../samplecode/prettier-typescript/out.ts | 6 +++ .../samplecode/prettier-yaml/in.yamllint | 1 + .../samplecode/prettier-yaml/in.yml | 13 ++++++ .../samplecode/prettier-yaml/out.yamllint | 1 + .../samplecode/prettier-yaml/out.yml | 10 +++++ test/formatters/samplecode/prettier/in.css | 14 +------ .../formatters/samplecode/prettier/in.graphql | 1 + test/formatters/samplecode/prettier/in.html | 2 +- test/formatters/samplecode/prettier/in.js | 5 +-- test/formatters/samplecode/prettier/in.json | 2 +- test/formatters/samplecode/prettier/in.md | 1 + test/formatters/samplecode/prettier/in.scss | 2 +- test/formatters/samplecode/prettier/in.ts | 2 +- test/formatters/samplecode/prettier/in.yml | 14 +------ test/formatters/samplecode/prettier/out.css | 7 +--- .../samplecode/prettier/out.graphql | 1 + test/formatters/samplecode/prettier/out.html | 6 +-- test/formatters/samplecode/prettier/out.js | 11 +---- test/formatters/samplecode/prettier/out.json | 20 +--------- test/formatters/samplecode/prettier/out.md | 1 + test/formatters/samplecode/prettier/out.scss | 10 +---- test/formatters/samplecode/prettier/out.ts | 7 +--- test/formatters/samplecode/prettier/out.yml | 11 +---- 52 files changed, 231 insertions(+), 108 deletions(-) create mode 120000 test/formatters/installers/prettier-css.bash create mode 120000 test/formatters/installers/prettier-graphql.bash create mode 120000 test/formatters/installers/prettier-html.bash create mode 120000 test/formatters/installers/prettier-javascript.bash create mode 120000 test/formatters/installers/prettier-json.bash create mode 120000 test/formatters/installers/prettier-markdown.bash create mode 100644 test/formatters/installers/prettier-ruby.bash create mode 120000 test/formatters/installers/prettier-scss.bash create mode 120000 test/formatters/installers/prettier-typescript.bash create mode 120000 test/formatters/installers/prettier-yaml.bash create mode 100644 test/formatters/samplecode/prettier-css/in.css create mode 100644 test/formatters/samplecode/prettier-css/out.css create mode 100644 test/formatters/samplecode/prettier-graphql/in.graphql create mode 100644 test/formatters/samplecode/prettier-graphql/out.graphql create mode 100644 test/formatters/samplecode/prettier-html/in.html create mode 100644 test/formatters/samplecode/prettier-html/out.html create mode 100644 test/formatters/samplecode/prettier-javascript/in.js create mode 100644 test/formatters/samplecode/prettier-javascript/out.js create mode 100644 test/formatters/samplecode/prettier-json/in.json create mode 100644 test/formatters/samplecode/prettier-json/out.json create mode 100644 test/formatters/samplecode/prettier-markdown/in.md create mode 100644 test/formatters/samplecode/prettier-markdown/out.md create mode 100644 test/formatters/samplecode/prettier-ruby/in.rb create mode 100644 test/formatters/samplecode/prettier-ruby/out.rb create mode 100644 test/formatters/samplecode/prettier-scss/in.scss create mode 100644 test/formatters/samplecode/prettier-scss/out.scss create mode 100644 test/formatters/samplecode/prettier-typescript/in.ts create mode 100644 test/formatters/samplecode/prettier-typescript/out.ts create mode 120000 test/formatters/samplecode/prettier-yaml/in.yamllint create mode 100644 test/formatters/samplecode/prettier-yaml/in.yml create mode 120000 test/formatters/samplecode/prettier-yaml/out.yamllint create mode 100644 test/formatters/samplecode/prettier-yaml/out.yml mode change 100644 => 120000 test/formatters/samplecode/prettier/in.css create mode 120000 test/formatters/samplecode/prettier/in.graphql mode change 100644 => 120000 test/formatters/samplecode/prettier/in.html mode change 100644 => 120000 test/formatters/samplecode/prettier/in.js mode change 100644 => 120000 test/formatters/samplecode/prettier/in.json create mode 120000 test/formatters/samplecode/prettier/in.md mode change 100644 => 120000 test/formatters/samplecode/prettier/in.scss mode change 100644 => 120000 test/formatters/samplecode/prettier/in.ts mode change 100644 => 120000 test/formatters/samplecode/prettier/in.yml mode change 100644 => 120000 test/formatters/samplecode/prettier/out.css create mode 120000 test/formatters/samplecode/prettier/out.graphql mode change 100644 => 120000 test/formatters/samplecode/prettier/out.html mode change 100644 => 120000 test/formatters/samplecode/prettier/out.js mode change 100644 => 120000 test/formatters/samplecode/prettier/out.json create mode 120000 test/formatters/samplecode/prettier/out.md mode change 100644 => 120000 test/formatters/samplecode/prettier/out.scss mode change 100644 => 120000 test/formatters/samplecode/prettier/out.ts mode change 100644 => 120000 test/formatters/samplecode/prettier/out.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e4b834..0498d7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ The format is based on [Keep a Changelog]. * Buffer content is now always passed to formatters using a pipe. This fixes issues with formatters that behave differently when receiving input on stdin versus being run on a tty ([#119]). +* Prettier now specifies `--parser` argument explicitly, so it will + work properly even when the name of the file does not match what + Prettier expects (e.g. `.yamllint` will be formatted as YAML by + Prettier as long as it is in `yaml-mode`). See [#103]. ### Bugs fixed * When a formatter has a bug and fails to return anything on stdout @@ -29,10 +33,17 @@ The format is based on [Keep a Changelog]. * [stylua](https://github.com/JohnnyMorganz/StyLua) for Lua ([#105]). * Native Emacs indentation of Emacs Lisp code as a formatter ([#102]). +### Bugfixes +* Prettier supports SCSS instead of SASS. The original support for + SASS in Apheleia was a bug because Prettier actually never had + support for SASS in the first place, so Apheleia would have failed + anyway on trying to format a SASS file. + [#43]: https://github.com/radian-software/apheleia/issues/43 [#100]: https://github.com/radian-software/apheleia/pull/100 [#101]: https://github.com/radian-software/apheleia/pull/101 [#102]: https://github.com/radian-software/apheleia/pull/102 +[#103]: https://github.com/radian-software/apheleia/issues/103 [#105]: https://github.com/radian-software/apheleia/pull/105 [#109]: https://github.com/radian-software/apheleia/issues/109 [#110]: https://github.com/radian-software/apheleia/pull/110 diff --git a/apheleia.el b/apheleia.el index 46ff829..379fd0d 100644 --- a/apheleia.el +++ b/apheleia.el @@ -940,6 +940,26 @@ being run, for diagnostic purposes." "--enable-outside-detected-project")) (phpcs . ("apheleia-phpcs")) (prettier . (npx "prettier" "--stdin-filepath" filepath)) + (prettier-css + . (npx "prettier" "--stdin-filepath" filepath "--parser=css")) + (prettier-html + . (npx "prettier" "--stdin-filepath" filepath "--parser=html")) + (prettier-graphql + . (npx "prettier" "--stdin-filepath" filepath "--parser=graphql")) + (prettier-javascript + . (npx "prettier" "--stdin-filepath" filepath "--parser=babel-flow")) + (prettier-json + . (npx "prettier" "--stdin-filepath" filepath "--parser=json")) + (prettier-markdown + . (npx "prettier" "--stdin-filepath" filepath "--parser=markdown")) + (prettier-ruby + . (npx "prettier" "--stdin-filepath" filepath "--parser=ruby")) + (prettier-scss + . (npx "prettier" "--stdin-filepath" filepath "--parser=scss")) + (prettier-typescript + . (npx "prettier" "--stdin-filepath" filepath "--parser=typescript")) + (prettier-yaml + . (npx "prettier" "--stdin-filepath" filepath "--parser=yaml")) (shfmt . ("shfmt" "-i" "4")) (stylua . ("stylua" "-")) (rustfmt . ("rustfmt" "--quiet" "--emit" "stdout")) @@ -1073,25 +1093,27 @@ function: %s" command))) (defcustom apheleia-mode-alist '(;; php-mode has to come before cc-mode (php-mode . phpcs) + ;; rest are alphabetical (beancount-mode . bean-format) (cc-mode . clang-format) (c-mode . clang-format) (c++-mode . clang-format) (caml-mode . ocamlformat) (common-lisp-mode . lisp-indent) - (css-mode . prettier) + (css-mode . prettier-css) (dart-mode . dart-format) (emacs-lisp-mode . lisp-indent) (elixir-mode . mix-format) (elm-mode . elm-format) (fish-mode . fish-indent) (go-mode . gofmt) + (graphql-mode . prettier-graphql) (haskell-mode . brittany) - (html-mode . prettier) + (html-mode . prettier-html) (java-mode . google-java-format) - (js3-mode . prettier) - (js-mode . prettier) - (json-mode . prettier) + (js3-mode . prettier-javascript) + (js-mode . prettier-javascript) + (json-mode . prettier-json) (kotlin-mode . ktlint) (latex-mode . latexindent) (LaTeX-mode . latexindent) @@ -1099,18 +1121,18 @@ function: %s" command))) (lisp-mode . lisp-indent) (nix-mode . nixfmt) (python-mode . black) - (ruby-mode . prettier) + (ruby-mode . prettier-ruby) (rustic-mode . rustfmt) (rust-mode . rustfmt) - (sass-mode . prettier) + (scss-mode . prettier-scss) (sh-mode . shfmt) (terraform-mode . terraform) (TeX-latex-mode . latexindent) (TeX-mode . latexindent) (tuareg-mode . ocamlformat) - (typescript-mode . prettier) + (typescript-mode . prettier-typescript) (web-mode . prettier) - (yaml-mode . prettier)) + (yaml-mode . prettier-yaml)) "Alist mapping major mode names to formatters to use in those modes. This determines what formatter to use in buffers without a setting for `apheleia-formatter'. The keys are major mode diff --git a/test/formatters/installers/prettier-css.bash b/test/formatters/installers/prettier-css.bash new file mode 120000 index 0000000..5f5c884 --- /dev/null +++ b/test/formatters/installers/prettier-css.bash @@ -0,0 +1 @@ +prettier.bash \ No newline at end of file diff --git a/test/formatters/installers/prettier-graphql.bash b/test/formatters/installers/prettier-graphql.bash new file mode 120000 index 0000000..5f5c884 --- /dev/null +++ b/test/formatters/installers/prettier-graphql.bash @@ -0,0 +1 @@ +prettier.bash \ No newline at end of file diff --git a/test/formatters/installers/prettier-html.bash b/test/formatters/installers/prettier-html.bash new file mode 120000 index 0000000..5f5c884 --- /dev/null +++ b/test/formatters/installers/prettier-html.bash @@ -0,0 +1 @@ +prettier.bash \ No newline at end of file diff --git a/test/formatters/installers/prettier-javascript.bash b/test/formatters/installers/prettier-javascript.bash new file mode 120000 index 0000000..5f5c884 --- /dev/null +++ b/test/formatters/installers/prettier-javascript.bash @@ -0,0 +1 @@ +prettier.bash \ No newline at end of file diff --git a/test/formatters/installers/prettier-json.bash b/test/formatters/installers/prettier-json.bash new file mode 120000 index 0000000..5f5c884 --- /dev/null +++ b/test/formatters/installers/prettier-json.bash @@ -0,0 +1 @@ +prettier.bash \ No newline at end of file diff --git a/test/formatters/installers/prettier-markdown.bash b/test/formatters/installers/prettier-markdown.bash new file mode 120000 index 0000000..5f5c884 --- /dev/null +++ b/test/formatters/installers/prettier-markdown.bash @@ -0,0 +1 @@ +prettier.bash \ No newline at end of file diff --git a/test/formatters/installers/prettier-ruby.bash b/test/formatters/installers/prettier-ruby.bash new file mode 100644 index 0000000..611f5c6 --- /dev/null +++ b/test/formatters/installers/prettier-ruby.bash @@ -0,0 +1,15 @@ +# Need ruby for gem, need gcc and ruby headers for native gem deps +apt-get install -y ruby ruby-dev gcc + +# Install the plugin +npm install -g prettier @prettier/plugin-ruby + +# Have to install from source because release not tagged yet +# https://github.com/ruby-syntax-tree/syntax_tree-rbs/pull/34 +# https://stackoverflow.com/a/11767563 +gem install specific_install +gem specific_install -l https://github.com/ruby-syntax-tree/syntax_tree-rbs.git + +# These are required dependencies documented at +# https://www.npmjs.com/package/@prettier/plugin-ruby +gem install prettier_print syntax_tree syntax_tree-haml syntax_tree-rbs diff --git a/test/formatters/installers/prettier-scss.bash b/test/formatters/installers/prettier-scss.bash new file mode 120000 index 0000000..5f5c884 --- /dev/null +++ b/test/formatters/installers/prettier-scss.bash @@ -0,0 +1 @@ +prettier.bash \ No newline at end of file diff --git a/test/formatters/installers/prettier-typescript.bash b/test/formatters/installers/prettier-typescript.bash new file mode 120000 index 0000000..5f5c884 --- /dev/null +++ b/test/formatters/installers/prettier-typescript.bash @@ -0,0 +1 @@ +prettier.bash \ No newline at end of file diff --git a/test/formatters/installers/prettier-yaml.bash b/test/formatters/installers/prettier-yaml.bash new file mode 120000 index 0000000..5f5c884 --- /dev/null +++ b/test/formatters/installers/prettier-yaml.bash @@ -0,0 +1 @@ +prettier.bash \ No newline at end of file diff --git a/test/formatters/samplecode/prettier-css/in.css b/test/formatters/samplecode/prettier-css/in.css new file mode 100644 index 0000000..55d5d36 --- /dev/null +++ b/test/formatters/samplecode/prettier-css/in.css @@ -0,0 +1,13 @@ + body + +{ + padding-left : 11em; +font-family + : Georgia, + + "Times New Roman", + Times, serif; + color: purple; + background-color: + #d8da3d + } diff --git a/test/formatters/samplecode/prettier-css/out.css b/test/formatters/samplecode/prettier-css/out.css new file mode 100644 index 0000000..9158996 --- /dev/null +++ b/test/formatters/samplecode/prettier-css/out.css @@ -0,0 +1,6 @@ +body { + padding-left: 11em; + font-family: Georgia, "Times New Roman", Times, serif; + color: purple; + background-color: #d8da3d; +} diff --git a/test/formatters/samplecode/prettier-graphql/in.graphql b/test/formatters/samplecode/prettier-graphql/in.graphql new file mode 100644 index 0000000..72fc73e --- /dev/null +++ b/test/formatters/samplecode/prettier-graphql/in.graphql @@ -0,0 +1 @@ +{human(id: "1000") {name height(unit: FOOT)}} diff --git a/test/formatters/samplecode/prettier-graphql/out.graphql b/test/formatters/samplecode/prettier-graphql/out.graphql new file mode 100644 index 0000000..f406f63 --- /dev/null +++ b/test/formatters/samplecode/prettier-graphql/out.graphql @@ -0,0 +1,6 @@ +{ + human(id: "1000") { + name + height(unit: FOOT) + } +} diff --git a/test/formatters/samplecode/prettier-html/in.html b/test/formatters/samplecode/prettier-html/in.html new file mode 100644 index 0000000..87c9e3e --- /dev/null +++ b/test/formatters/samplecode/prettier-html/in.html @@ -0,0 +1 @@ +

Minify HTML and any CSS or JS included in your markup

diff --git a/test/formatters/samplecode/prettier-html/out.html b/test/formatters/samplecode/prettier-html/out.html new file mode 100644 index 0000000..7702be8 --- /dev/null +++ b/test/formatters/samplecode/prettier-html/out.html @@ -0,0 +1,5 @@ +

+ Minify HTML and any + CSS or + JS included in your markup +

diff --git a/test/formatters/samplecode/prettier-javascript/in.js b/test/formatters/samplecode/prettier-javascript/in.js new file mode 100644 index 0000000..fd56713 --- /dev/null +++ b/test/formatters/samplecode/prettier-javascript/in.js @@ -0,0 +1,4 @@ +function HelloWorld({greeting = "hello", greeted = '"World"', silent = false, onMouseOver,}) { + + if(!greeting){return null}; + } diff --git a/test/formatters/samplecode/prettier-javascript/out.js b/test/formatters/samplecode/prettier-javascript/out.js new file mode 100644 index 0000000..ec9cfe4 --- /dev/null +++ b/test/formatters/samplecode/prettier-javascript/out.js @@ -0,0 +1,10 @@ +function HelloWorld({ + greeting = "hello", + greeted = '"World"', + silent = false, + onMouseOver, +}) { + if (!greeting) { + return null; + } +} diff --git a/test/formatters/samplecode/prettier-json/in.json b/test/formatters/samplecode/prettier-json/in.json new file mode 100644 index 0000000..28dc75f --- /dev/null +++ b/test/formatters/samplecode/prettier-json/in.json @@ -0,0 +1 @@ +{"arrowParens":"always","bracketSpacing":true,"embeddedLanguageFormatting":"auto","htmlWhitespaceSensitivity":"css","insertPragma":false,"jsxBracketSameLine":false,"jsxSingleQuote":false,"printWidth":80,"proseWrap":"preserve","quoteProps":"as-needed","requirePragma":false,"semi":true,"singleQuote":false,"tabWidth":2,"trailingComma":"es5","useTabs":false,"vueIndentScriptAndStyle":false} diff --git a/test/formatters/samplecode/prettier-json/out.json b/test/formatters/samplecode/prettier-json/out.json new file mode 100644 index 0000000..59bb3b4 --- /dev/null +++ b/test/formatters/samplecode/prettier-json/out.json @@ -0,0 +1,19 @@ +{ + "arrowParens": "always", + "bracketSpacing": true, + "embeddedLanguageFormatting": "auto", + "htmlWhitespaceSensitivity": "css", + "insertPragma": false, + "jsxBracketSameLine": false, + "jsxSingleQuote": false, + "printWidth": 80, + "proseWrap": "preserve", + "quoteProps": "as-needed", + "requirePragma": false, + "semi": true, + "singleQuote": false, + "tabWidth": 2, + "trailingComma": "es5", + "useTabs": false, + "vueIndentScriptAndStyle": false +} diff --git a/test/formatters/samplecode/prettier-markdown/in.md b/test/formatters/samplecode/prettier-markdown/in.md new file mode 100644 index 0000000..7c3698b --- /dev/null +++ b/test/formatters/samplecode/prettier-markdown/in.md @@ -0,0 +1,4 @@ +|col1|col 2| +|-|-| +|nice|fits| +|oh no!|it's ugly!| diff --git a/test/formatters/samplecode/prettier-markdown/out.md b/test/formatters/samplecode/prettier-markdown/out.md new file mode 100644 index 0000000..4d08fcd --- /dev/null +++ b/test/formatters/samplecode/prettier-markdown/out.md @@ -0,0 +1,4 @@ +| col1 | col 2 | +| ------ | ---------- | +| nice | fits | +| oh no! | it's ugly! | diff --git a/test/formatters/samplecode/prettier-ruby/in.rb b/test/formatters/samplecode/prettier-ruby/in.rb new file mode 100644 index 0000000..2a2f35a --- /dev/null +++ b/test/formatters/samplecode/prettier-ruby/in.rb @@ -0,0 +1,13 @@ + d=[30644250780,9003106878, + 30636278846,66641217692,4501790980, + 671_24_603036,131_61973916,66_606629_920, + 30642677916,30643069058];a,s=[],$*[0] + s.each_byte{|b|a<<("%036b"%d[b. + chr.to_i]).scan(/\d{6}/)} + a.transpose.each{ |a| + a.join.each_byte{\ + |i|print i==49?\ + ($*[1]||"#")\ + :32.chr} + puts + } diff --git a/test/formatters/samplecode/prettier-ruby/out.rb b/test/formatters/samplecode/prettier-ruby/out.rb new file mode 100644 index 0000000..3bf1506 --- /dev/null +++ b/test/formatters/samplecode/prettier-ruby/out.rb @@ -0,0 +1,18 @@ +d = [ + 30_644_250_780, + 9_003_106_878, + 30_636_278_846, + 66_641_217_692, + 4_501_790_980, + 671_24_603036, + 131_61973916, + 66_606629_920, + 30_642_677_916, + 30_643_069_058 +] +a, s = [], $*[0] +s.each_byte { |b| a << ("%036b" % d[b.chr.to_i]).scan(/\d{6}/) } +a.transpose.each do |a| + a.join.each_byte { |i| print i == 49 ? ($*[1] || "#") : 32.chr } + puts +end diff --git a/test/formatters/samplecode/prettier-scss/in.scss b/test/formatters/samplecode/prettier-scss/in.scss new file mode 100644 index 0000000..e824587 --- /dev/null +++ b/test/formatters/samplecode/prettier-scss/in.scss @@ -0,0 +1 @@ +/* Define standard variables and values for website */$bgcolor: lightblue;$textcolor: darkblue;$fontsize: 18px;/* Use the variables */body{background-color: $bgcolor; color: $textcolor; font-size: $fontsize;} diff --git a/test/formatters/samplecode/prettier-scss/out.scss b/test/formatters/samplecode/prettier-scss/out.scss new file mode 100644 index 0000000..9ae1829 --- /dev/null +++ b/test/formatters/samplecode/prettier-scss/out.scss @@ -0,0 +1,9 @@ +/* Define standard variables and values for website */ +$bgcolor: lightblue; +$textcolor: darkblue; +$fontsize: 18px; /* Use the variables */ +body { + background-color: $bgcolor; + color: $textcolor; + font-size: $fontsize; +} diff --git a/test/formatters/samplecode/prettier-typescript/in.ts b/test/formatters/samplecode/prettier-typescript/in.ts new file mode 100644 index 0000000..c75d40f --- /dev/null +++ b/test/formatters/samplecode/prettier-typescript/in.ts @@ -0,0 +1 @@ +interface GreetingSettings{greeting: string; duration?: number; color?: string;}declare function greet(setting: GreetingSettings): void; diff --git a/test/formatters/samplecode/prettier-typescript/out.ts b/test/formatters/samplecode/prettier-typescript/out.ts new file mode 100644 index 0000000..143b5a7 --- /dev/null +++ b/test/formatters/samplecode/prettier-typescript/out.ts @@ -0,0 +1,6 @@ +interface GreetingSettings { + greeting: string; + duration?: number; + color?: string; +} +declare function greet(setting: GreetingSettings): void; diff --git a/test/formatters/samplecode/prettier-yaml/in.yamllint b/test/formatters/samplecode/prettier-yaml/in.yamllint new file mode 120000 index 0000000..8abb818 --- /dev/null +++ b/test/formatters/samplecode/prettier-yaml/in.yamllint @@ -0,0 +1 @@ +in.yml \ No newline at end of file diff --git a/test/formatters/samplecode/prettier-yaml/in.yml b/test/formatters/samplecode/prettier-yaml/in.yml new file mode 100644 index 0000000..19f33ef --- /dev/null +++ b/test/formatters/samplecode/prettier-yaml/in.yml @@ -0,0 +1,13 @@ +--- +- hosts: + all + + tasks: + - name: + Get software for apt repository management. + apt: + state: present + + + name: + - python3-pycurl diff --git a/test/formatters/samplecode/prettier-yaml/out.yamllint b/test/formatters/samplecode/prettier-yaml/out.yamllint new file mode 120000 index 0000000..fb705fe --- /dev/null +++ b/test/formatters/samplecode/prettier-yaml/out.yamllint @@ -0,0 +1 @@ +out.yml \ No newline at end of file diff --git a/test/formatters/samplecode/prettier-yaml/out.yml b/test/formatters/samplecode/prettier-yaml/out.yml new file mode 100644 index 0000000..4163e5e --- /dev/null +++ b/test/formatters/samplecode/prettier-yaml/out.yml @@ -0,0 +1,10 @@ +--- +- hosts: all + + tasks: + - name: Get software for apt repository management. + apt: + state: present + + name: + - python3-pycurl diff --git a/test/formatters/samplecode/prettier/in.css b/test/formatters/samplecode/prettier/in.css deleted file mode 100644 index 55d5d36..0000000 --- a/test/formatters/samplecode/prettier/in.css +++ /dev/null @@ -1,13 +0,0 @@ - body - -{ - padding-left : 11em; -font-family - : Georgia, - - "Times New Roman", - Times, serif; - color: purple; - background-color: - #d8da3d - } diff --git a/test/formatters/samplecode/prettier/in.css b/test/formatters/samplecode/prettier/in.css new file mode 120000 index 0000000..d979eb8 --- /dev/null +++ b/test/formatters/samplecode/prettier/in.css @@ -0,0 +1 @@ +../prettier-css/in.css \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/in.graphql b/test/formatters/samplecode/prettier/in.graphql new file mode 120000 index 0000000..bb44c12 --- /dev/null +++ b/test/formatters/samplecode/prettier/in.graphql @@ -0,0 +1 @@ +../prettier-graphql/in.graphql \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/in.html b/test/formatters/samplecode/prettier/in.html deleted file mode 100644 index 87c9e3e..0000000 --- a/test/formatters/samplecode/prettier/in.html +++ /dev/null @@ -1 +0,0 @@ -

Minify HTML and any CSS or JS included in your markup

diff --git a/test/formatters/samplecode/prettier/in.html b/test/formatters/samplecode/prettier/in.html new file mode 120000 index 0000000..60609ad --- /dev/null +++ b/test/formatters/samplecode/prettier/in.html @@ -0,0 +1 @@ +../prettier-html/in.html \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/in.js b/test/formatters/samplecode/prettier/in.js deleted file mode 100644 index fd56713..0000000 --- a/test/formatters/samplecode/prettier/in.js +++ /dev/null @@ -1,4 +0,0 @@ -function HelloWorld({greeting = "hello", greeted = '"World"', silent = false, onMouseOver,}) { - - if(!greeting){return null}; - } diff --git a/test/formatters/samplecode/prettier/in.js b/test/formatters/samplecode/prettier/in.js new file mode 120000 index 0000000..da49303 --- /dev/null +++ b/test/formatters/samplecode/prettier/in.js @@ -0,0 +1 @@ +../prettier-javascript/in.js \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/in.json b/test/formatters/samplecode/prettier/in.json deleted file mode 100644 index 28dc75f..0000000 --- a/test/formatters/samplecode/prettier/in.json +++ /dev/null @@ -1 +0,0 @@ -{"arrowParens":"always","bracketSpacing":true,"embeddedLanguageFormatting":"auto","htmlWhitespaceSensitivity":"css","insertPragma":false,"jsxBracketSameLine":false,"jsxSingleQuote":false,"printWidth":80,"proseWrap":"preserve","quoteProps":"as-needed","requirePragma":false,"semi":true,"singleQuote":false,"tabWidth":2,"trailingComma":"es5","useTabs":false,"vueIndentScriptAndStyle":false} diff --git a/test/formatters/samplecode/prettier/in.json b/test/formatters/samplecode/prettier/in.json new file mode 120000 index 0000000..599a1e2 --- /dev/null +++ b/test/formatters/samplecode/prettier/in.json @@ -0,0 +1 @@ +../prettier-json/in.json \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/in.md b/test/formatters/samplecode/prettier/in.md new file mode 120000 index 0000000..99482b8 --- /dev/null +++ b/test/formatters/samplecode/prettier/in.md @@ -0,0 +1 @@ +../prettier-markdown/in.md \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/in.scss b/test/formatters/samplecode/prettier/in.scss deleted file mode 100644 index e824587..0000000 --- a/test/formatters/samplecode/prettier/in.scss +++ /dev/null @@ -1 +0,0 @@ -/* Define standard variables and values for website */$bgcolor: lightblue;$textcolor: darkblue;$fontsize: 18px;/* Use the variables */body{background-color: $bgcolor; color: $textcolor; font-size: $fontsize;} diff --git a/test/formatters/samplecode/prettier/in.scss b/test/formatters/samplecode/prettier/in.scss new file mode 120000 index 0000000..c07bcb8 --- /dev/null +++ b/test/formatters/samplecode/prettier/in.scss @@ -0,0 +1 @@ +../prettier-scss/in.scss \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/in.ts b/test/formatters/samplecode/prettier/in.ts deleted file mode 100644 index c75d40f..0000000 --- a/test/formatters/samplecode/prettier/in.ts +++ /dev/null @@ -1 +0,0 @@ -interface GreetingSettings{greeting: string; duration?: number; color?: string;}declare function greet(setting: GreetingSettings): void; diff --git a/test/formatters/samplecode/prettier/in.ts b/test/formatters/samplecode/prettier/in.ts new file mode 120000 index 0000000..1b5f9d6 --- /dev/null +++ b/test/formatters/samplecode/prettier/in.ts @@ -0,0 +1 @@ +../prettier-typescript/in.ts \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/in.yml b/test/formatters/samplecode/prettier/in.yml deleted file mode 100644 index 19f33ef..0000000 --- a/test/formatters/samplecode/prettier/in.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- hosts: - all - - tasks: - - name: - Get software for apt repository management. - apt: - state: present - - - name: - - python3-pycurl diff --git a/test/formatters/samplecode/prettier/in.yml b/test/formatters/samplecode/prettier/in.yml new file mode 120000 index 0000000..bdbc9aa --- /dev/null +++ b/test/formatters/samplecode/prettier/in.yml @@ -0,0 +1 @@ +../prettier-yaml/in.yml \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/out.css b/test/formatters/samplecode/prettier/out.css deleted file mode 100644 index 9158996..0000000 --- a/test/formatters/samplecode/prettier/out.css +++ /dev/null @@ -1,6 +0,0 @@ -body { - padding-left: 11em; - font-family: Georgia, "Times New Roman", Times, serif; - color: purple; - background-color: #d8da3d; -} diff --git a/test/formatters/samplecode/prettier/out.css b/test/formatters/samplecode/prettier/out.css new file mode 120000 index 0000000..603e0aa --- /dev/null +++ b/test/formatters/samplecode/prettier/out.css @@ -0,0 +1 @@ +../prettier-css/out.css \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/out.graphql b/test/formatters/samplecode/prettier/out.graphql new file mode 120000 index 0000000..64254cf --- /dev/null +++ b/test/formatters/samplecode/prettier/out.graphql @@ -0,0 +1 @@ +../prettier-graphql/out.graphql \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/out.html b/test/formatters/samplecode/prettier/out.html deleted file mode 100644 index 7702be8..0000000 --- a/test/formatters/samplecode/prettier/out.html +++ /dev/null @@ -1,5 +0,0 @@ -

- Minify HTML and any - CSS or - JS included in your markup -

diff --git a/test/formatters/samplecode/prettier/out.html b/test/formatters/samplecode/prettier/out.html new file mode 120000 index 0000000..c9a40ad --- /dev/null +++ b/test/formatters/samplecode/prettier/out.html @@ -0,0 +1 @@ +../prettier-html/out.html \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/out.js b/test/formatters/samplecode/prettier/out.js deleted file mode 100644 index ec9cfe4..0000000 --- a/test/formatters/samplecode/prettier/out.js +++ /dev/null @@ -1,10 +0,0 @@ -function HelloWorld({ - greeting = "hello", - greeted = '"World"', - silent = false, - onMouseOver, -}) { - if (!greeting) { - return null; - } -} diff --git a/test/formatters/samplecode/prettier/out.js b/test/formatters/samplecode/prettier/out.js new file mode 120000 index 0000000..83d53e7 --- /dev/null +++ b/test/formatters/samplecode/prettier/out.js @@ -0,0 +1 @@ +../prettier-javascript/out.js \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/out.json b/test/formatters/samplecode/prettier/out.json deleted file mode 100644 index 59bb3b4..0000000 --- a/test/formatters/samplecode/prettier/out.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "arrowParens": "always", - "bracketSpacing": true, - "embeddedLanguageFormatting": "auto", - "htmlWhitespaceSensitivity": "css", - "insertPragma": false, - "jsxBracketSameLine": false, - "jsxSingleQuote": false, - "printWidth": 80, - "proseWrap": "preserve", - "quoteProps": "as-needed", - "requirePragma": false, - "semi": true, - "singleQuote": false, - "tabWidth": 2, - "trailingComma": "es5", - "useTabs": false, - "vueIndentScriptAndStyle": false -} diff --git a/test/formatters/samplecode/prettier/out.json b/test/formatters/samplecode/prettier/out.json new file mode 120000 index 0000000..018b8c2 --- /dev/null +++ b/test/formatters/samplecode/prettier/out.json @@ -0,0 +1 @@ +../prettier-json/out.json \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/out.md b/test/formatters/samplecode/prettier/out.md new file mode 120000 index 0000000..e58dfd7 --- /dev/null +++ b/test/formatters/samplecode/prettier/out.md @@ -0,0 +1 @@ +../prettier-markdown/out.md \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/out.scss b/test/formatters/samplecode/prettier/out.scss deleted file mode 100644 index 9ae1829..0000000 --- a/test/formatters/samplecode/prettier/out.scss +++ /dev/null @@ -1,9 +0,0 @@ -/* Define standard variables and values for website */ -$bgcolor: lightblue; -$textcolor: darkblue; -$fontsize: 18px; /* Use the variables */ -body { - background-color: $bgcolor; - color: $textcolor; - font-size: $fontsize; -} diff --git a/test/formatters/samplecode/prettier/out.scss b/test/formatters/samplecode/prettier/out.scss new file mode 120000 index 0000000..1e914a4 --- /dev/null +++ b/test/formatters/samplecode/prettier/out.scss @@ -0,0 +1 @@ +../prettier-scss/out.scss \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/out.ts b/test/formatters/samplecode/prettier/out.ts deleted file mode 100644 index 143b5a7..0000000 --- a/test/formatters/samplecode/prettier/out.ts +++ /dev/null @@ -1,6 +0,0 @@ -interface GreetingSettings { - greeting: string; - duration?: number; - color?: string; -} -declare function greet(setting: GreetingSettings): void; diff --git a/test/formatters/samplecode/prettier/out.ts b/test/formatters/samplecode/prettier/out.ts new file mode 120000 index 0000000..022e7b8 --- /dev/null +++ b/test/formatters/samplecode/prettier/out.ts @@ -0,0 +1 @@ +../prettier-typescript/out.ts \ No newline at end of file diff --git a/test/formatters/samplecode/prettier/out.yml b/test/formatters/samplecode/prettier/out.yml deleted file mode 100644 index 4163e5e..0000000 --- a/test/formatters/samplecode/prettier/out.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- hosts: all - - tasks: - - name: Get software for apt repository management. - apt: - state: present - - name: - - python3-pycurl diff --git a/test/formatters/samplecode/prettier/out.yml b/test/formatters/samplecode/prettier/out.yml new file mode 120000 index 0000000..b0f089e --- /dev/null +++ b/test/formatters/samplecode/prettier/out.yml @@ -0,0 +1 @@ +../prettier-yaml/out.yml \ No newline at end of file