Skip to content

Commit

Permalink
Update/add more plugins and sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Nov 24, 2023
1 parent c4cad36 commit e13e245
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/formatters/installers/dprint.bash
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
npm install -g dprint

# Included: WASM plugins, preferring first over 3rd party wrappers
# where redundant (e.g. -typescript and -json instead of -biome)
cat <<\EOF >/tmp/dprint.json
{
"toml": {},
"excludes": [],
"plugins": [
"https://plugins.dprint.dev/toml-0.5.4.wasm"
"https://plugins.dprint.dev/dockerfile-0.3.0.wasm",
"https://plugins.dprint.dev/json-0.19.1.wasm",
"https://plugins.dprint.dev/markdown-0.16.3.wasm",
"https://plugins.dprint.dev/ruff-0.0.2.wasm",
"https://plugins.dprint.dev/toml-0.5.4.wasm",
"https://plugins.dprint.dev/typescript-0.88.5.wasm"
]
}
EOF
dprint config update

# dprint config update # not done to keep formatting stable
1 change: 1 addition & 0 deletions test/formatters/samplecode/dprint/in.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM scratch
1 change: 1 addition & 0 deletions test/formatters/samplecode/dprint/in.js
1 change: 1 addition & 0 deletions test/formatters/samplecode/dprint/in.json
1 change: 1 addition & 0 deletions test/formatters/samplecode/dprint/in.md
1 change: 1 addition & 0 deletions test/formatters/samplecode/dprint/in.py
1 change: 1 addition & 0 deletions test/formatters/samplecode/dprint/in.ts
1 change: 1 addition & 0 deletions test/formatters/samplecode/dprint/out.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM scratch
3 changes: 3 additions & 0 deletions test/formatters/samplecode/dprint/out.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function HelloWorld({ greeting = "hello", greeted = "\"World\"", silent = false, onMouseOver }) {
if (!greeting) return null;
}
19 changes: 19 additions & 0 deletions test/formatters/samplecode/dprint/out.json
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 4 additions & 0 deletions test/formatters/samplecode/dprint/out.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
| col1 | col 2 |
| ------ | ---------- |
| nice | fits |
| oh no! | it's ugly! |
3 changes: 3 additions & 0 deletions test/formatters/samplecode/dprint/out.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def asdjf(l, a):
3
+4

0 comments on commit e13e245

Please sign in to comment.