diff options
| author | Radon Rosborough <radon.neon@gmail.com> | 2022-09-10 17:24:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-10 17:24:54 -0700 |
| commit | 46d373f4bd0e4c3b46838912cd4c1b667ac557c3 (patch) | |
| tree | 2471452dc40bb34e08e7282150b7e01aeba2aa6d | |
| parent | 8ff45766fad9b32f78aa99fa9ab11b715baa07f7 (diff) | |
[#103] Specify --parser in Prettier (#107)
Closes #103
52 files changed, 231 insertions, 108 deletions
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 @@ +<h2>Minify <abbr title="HyperText Markup Language">HTML</abbr> and any <abbr title="Cascading Style Sheets">CSS</abbr> or <abbr title="JavaScript">JS</abbr> included in your markup</h2> 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 @@ +<h2> + Minify <abbr title="HyperText Markup Language">HTML</abbr> and any + <abbr title="Cascading Style Sheets">CSS</abbr> or + <abbr title="JavaScript">JS</abbr> included in your markup +</h2> 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 index 55d5d36..d979eb8 100644..120000 --- a/test/formatters/samplecode/prettier/in.css +++ b/test/formatters/samplecode/prettier/in.css @@ -1,13 +1 @@ - body - -{ - padding-left : 11em; -font-family - : Georgia, - - "Times New Roman", - Times, serif; - color: purple; - background-color: - #d8da3d - } +../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 index 87c9e3e..60609ad 100644..120000 --- a/test/formatters/samplecode/prettier/in.html +++ b/test/formatters/samplecode/prettier/in.html @@ -1 +1 @@ -<h2>Minify <abbr title="HyperText Markup Language">HTML</abbr> and any <abbr title="Cascading Style Sheets">CSS</abbr> or <abbr title="JavaScript">JS</abbr> included in your markup</h2> +../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 index fd56713..da49303 100644..120000 --- a/test/formatters/samplecode/prettier/in.js +++ b/test/formatters/samplecode/prettier/in.js @@ -1,4 +1 @@ -function HelloWorld({greeting = "hello", greeted = '"World"', silent = false, onMouseOver,}) { - - if(!greeting){return null}; - } +../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 index 28dc75f..599a1e2 100644..120000 --- a/test/formatters/samplecode/prettier/in.json +++ b/test/formatters/samplecode/prettier/in.json @@ -1 +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} +../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 index e824587..c07bcb8 100644..120000 --- a/test/formatters/samplecode/prettier/in.scss +++ b/test/formatters/samplecode/prettier/in.scss @@ -1 +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;} +../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 index c75d40f..1b5f9d6 100644..120000 --- a/test/formatters/samplecode/prettier/in.ts +++ b/test/formatters/samplecode/prettier/in.ts @@ -1 +1 @@ -interface GreetingSettings{greeting: string; duration?: number; color?: string;}declare function greet(setting: GreetingSettings): void; +../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 index 19f33ef..bdbc9aa 100644..120000 --- a/test/formatters/samplecode/prettier/in.yml +++ b/test/formatters/samplecode/prettier/in.yml @@ -1,13 +1 @@ ---- -- hosts: - all - - tasks: - - name: - Get software for apt repository management. - apt: - state: present - - - name: - - python3-pycurl +../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 index 9158996..603e0aa 100644..120000 --- a/test/formatters/samplecode/prettier/out.css +++ b/test/formatters/samplecode/prettier/out.css @@ -1,6 +1 @@ -body { - padding-left: 11em; - font-family: Georgia, "Times New Roman", Times, serif; - color: purple; - background-color: #d8da3d; -} +../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 index 7702be8..c9a40ad 100644..120000 --- a/test/formatters/samplecode/prettier/out.html +++ b/test/formatters/samplecode/prettier/out.html @@ -1,5 +1 @@ -<h2> - Minify <abbr title="HyperText Markup Language">HTML</abbr> and any - <abbr title="Cascading Style Sheets">CSS</abbr> or - <abbr title="JavaScript">JS</abbr> included in your markup -</h2> +../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 index ec9cfe4..83d53e7 100644..120000 --- a/test/formatters/samplecode/prettier/out.js +++ b/test/formatters/samplecode/prettier/out.js @@ -1,10 +1 @@ -function HelloWorld({ - greeting = "hello", - greeted = '"World"', - silent = false, - onMouseOver, -}) { - if (!greeting) { - return null; - } -} +../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 index 59bb3b4..018b8c2 100644..120000 --- a/test/formatters/samplecode/prettier/out.json +++ b/test/formatters/samplecode/prettier/out.json @@ -1,19 +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 -} +../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 index 9ae1829..1e914a4 100644..120000 --- a/test/formatters/samplecode/prettier/out.scss +++ b/test/formatters/samplecode/prettier/out.scss @@ -1,9 +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; -} +../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 index 143b5a7..022e7b8 100644..120000 --- a/test/formatters/samplecode/prettier/out.ts +++ b/test/formatters/samplecode/prettier/out.ts @@ -1,6 +1 @@ -interface GreetingSettings { - greeting: string; - duration?: number; - color?: string; -} -declare function greet(setting: GreetingSettings): void; +../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 index 4163e5e..b0f089e 100644..120000 --- a/test/formatters/samplecode/prettier/out.yml +++ b/test/formatters/samplecode/prettier/out.yml @@ -1,10 +1 @@ ---- -- hosts: all - - tasks: - - name: Get software for apt repository management. - apt: - state: present - - name: - - python3-pycurl +../prettier-yaml/out.yml
\ No newline at end of file |
