Skip to content

Commit 144c038

Browse files
committed
style: add prettier
1 parent 6a3b32d commit 144c038

File tree

7 files changed

+39
-12
lines changed

7 files changed

+39
-12
lines changed

.travis.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
language: minimal
1+
language: node_js
2+
node_js: '14'
3+
cache:
4+
yarn: true
25

36
env:
47
global:
@@ -19,6 +22,7 @@ before_install:
1922
- sudo apt-get install -y powershell dotnet-sdk-3.1
2023

2124
script:
25+
- yarn prettier-check
2226
- pwsh -c 'Import-Module ./PSSourcegraph/PSSourcegraph.psd1'
2327

2428
if: tag IS blank
@@ -27,11 +31,6 @@ jobs:
2731
include:
2832
- stage: test
2933
- stage: release
30-
# Publish-Module needs dotnet CLI
31-
language: node_js
32-
node_js: '14'
33-
cache:
34-
yarn: true
3534
install:
3635
- yarn --frozen-lockfile
3736
script:

.vscode/extensions.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"recommendations": [
33
"ms-vscode.PowerShell",
4-
"redhat.vscode-xml"
5-
]
4+
"redhat.vscode-xml",
5+
"apollographql.vscode-apollo",
6+
"esbenp.prettier-vscode",
7+
"EditorConfig.EditorConfig",
8+
],
69
}

.vscode/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"xml.fileAssociations": [
33
{
44
"systemId": "https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Schemas/Format.xsd",
5-
"pattern": "**/*.Format.ps1xml"
5+
"pattern": "**/*.Format.ps1xml",
66
},
77
{
88
"systemId": "https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Schemas/Types.xsd",
9-
"pattern": "**/*.Types.ps1xml"
9+
"pattern": "**/*.Types.ps1xml",
1010
},
11-
]
11+
],
1212
}

PSSourcegraph/queries/Reference.graphql

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
query References($repository: String!, $rev: String!, $path: String!, $line: Int!, $character: Int!, $first: Int, $after: String) {
1+
query References(
2+
$repository: String!
3+
$rev: String!
4+
$path: String!
5+
$line: Int!
6+
$character: Int!
7+
$first: Int
8+
$after: String
9+
) {
210
repository(name: $repository) {
311
commit(rev: $rev) {
412
blob(path: $path) {

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
{
22
"private": true,
3+
"scripts": {
4+
"prettier": "prettier '**/*.{graphql,md,json,js,yml}' --list-different --write",
5+
"prettier-check": "yarn prettier --write=false"
6+
},
37
"devDependencies": {
48
"@semantic-release/exec": "^5.0.0",
9+
"@sourcegraph/prettierrc": "^3.0.3",
10+
"prettier": "^2.0.5",
511
"semantic-release": "^17.0.8"
612
}
713
}

prettier.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@sourcegraph/prettierrc')

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@
237237
lodash "^4.17.4"
238238
read-pkg-up "^7.0.0"
239239

240+
"@sourcegraph/prettierrc@^3.0.3":
241+
version "3.0.3"
242+
resolved "https://registry.npmjs.org/@sourcegraph/prettierrc/-/prettierrc-3.0.3.tgz#51bfa9b2588fe35121593fa877143e6373028289"
243+
integrity sha512-FQ1/Ued4I02R0JkrHHofDN163juVxUnPALzfxPZrDZUHv+c3jHjfZhmTHEz+Wd+g3b7MFk0fkj36nZSnvPyU8A==
244+
240245
"@tootallnate/once@1":
241246
version "1.1.2"
242247
resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
@@ -3380,6 +3385,11 @@ prepend-http@^1.0.1:
33803385
resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
33813386
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=
33823387

3388+
prettier@^2.0.5:
3389+
version "2.0.5"
3390+
resolved "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
3391+
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
3392+
33833393
process-nextick-args@~2.0.0:
33843394
version "2.0.1"
33853395
resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"

0 commit comments

Comments
 (0)