Skip to content

Commit 78c5db3

Browse files
authored
Format and use LF line endings on text files (#769)
1 parent 423f836 commit 78c5db3

143 files changed

Lines changed: 16085 additions & 14467 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
**/gradlew text eol=lf
22
**/*.sh text eol=lf
33
**/*.bat text eol=crlf
4+
**/*.gradle text eol=lf
5+
**/*.html text eol=lf
6+
**/*.md text eol=lf
7+
**/*.mjs text eol=lf
8+
**/*.js text eol=lf
9+
**/*.json text eol=lf
10+
**/*.ts text eol=lf
11+
**/*.txt text eol=lf
12+
**/*.yml text eol=lf

.github/workflows/main.yml

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
fetch-depth: 0
1313
- uses: actions/setup-node@v4
1414
with:
15-
node-version: '20.x'
15+
node-version: "20.x"
1616
- uses: actions/setup-java@v4
1717
with:
1818
java-version: 17
19-
distribution: 'temurin'
19+
distribution: "temurin"
2020
- run: ./gradlew build updateVersions updateAllDependencies -PbuildServer
2121
name: Build with Gradle
2222
- run: |
@@ -74,11 +74,11 @@ jobs:
7474
fetch-depth: 0
7575
- uses: actions/setup-node@v4
7676
with:
77-
node-version: '20.x'
77+
node-version: "20.x"
7878
- uses: actions/setup-java@v4
7979
with:
8080
java-version: 17
81-
distribution: 'temurin'
81+
distribution: "temurin"
8282
- run: ./gradlew build updateVersions updateAllDependencies -PbuildServer
8383
name: Build with Gradle
8484
- run: |
@@ -105,11 +105,11 @@ jobs:
105105
fetch-depth: 0
106106
- uses: actions/setup-node@v4
107107
with:
108-
node-version: '20.x'
108+
node-version: "20.x"
109109
- uses: actions/setup-java@v4
110110
with:
111111
java-version: 17
112-
distribution: 'temurin'
112+
distribution: "temurin"
113113
- run: ./gradlew build updateVersions updateAllDependencies -PbuildServer
114114
name: Build with Gradle
115115
- run: |
@@ -136,11 +136,11 @@ jobs:
136136
fetch-depth: 0
137137
- uses: actions/setup-node@v4
138138
with:
139-
node-version: '20.x'
139+
node-version: "20.x"
140140
- uses: actions/setup-java@v4
141141
with:
142142
java-version: 17
143-
distribution: 'temurin'
143+
distribution: "temurin"
144144
- run: ./gradlew build updateVersions updateAllDependencies generateTemplateZip generateExamplesZip -PbuildServer
145145
name: Build with Gradle
146146
- run: |
@@ -161,6 +161,37 @@ jobs:
161161
name: Distributions
162162
path: ${{ github.workspace }}/build/distributions/*
163163

164+
format:
165+
name: Format
166+
runs-on: ubuntu-latest
167+
steps:
168+
- uses: actions/checkout@v4
169+
with:
170+
fetch-depth: 0
171+
- uses: actions/setup-node@v4
172+
with:
173+
node-version: "20.x"
174+
- name: Run Prettier
175+
run: npx prettier -w .
176+
working-directory: vscode-wpilib
177+
- name: Check output
178+
run: git --no-pager diff --exit-code HEAD
179+
- name: Generate diff
180+
run: git diff HEAD > format-fixes.patch
181+
if: ${{ failure() }}
182+
- uses: actions/upload-artifact@v4
183+
with:
184+
name: format fixes
185+
path: format-fixes.patch
186+
if: ${{ failure() }}
187+
- name: Write to job summary
188+
run: |
189+
echo '```diff' >> $GITHUB_STEP_SUMMARY
190+
cat format-fixes.patch >> $GITHUB_STEP_SUMMARY
191+
echo '' >> $GITHUB_STEP_SUMMARY
192+
echo '```' >> $GITHUB_STEP_SUMMARY
193+
if: ${{ failure() }}
194+
164195
release:
165196
name: "Release"
166197
runs-on: ubuntu-latest

.vscode/launch.json

Lines changed: 54 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3,69 +3,58 @@
33
// Hover to view descriptions of existing attributes.
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
{
6-
"version": "0.2.0",
7-
"configurations": [
8-
{
9-
"name": "Extension",
10-
"type": "extensionHost",
11-
"request": "launch",
12-
"runtimeExecutable": "${execPath}",
13-
"args": [
14-
"--extensionDevelopmentPath=${workspaceFolder}/vscode-wpilib"
15-
],
16-
"outFiles": [
17-
"${workspaceFolder}/vscode-wpilib/out/**/*.js"
18-
],
19-
"preLaunchTask": "vscode-web-watch"
20-
},
21-
{
22-
"name": "Extension Tests",
23-
"type": "extensionHost",
24-
"request": "launch",
25-
"runtimeExecutable": "${execPath}",
26-
"args": [
27-
"--extensionDevelopmentPath=${workspaceFolder}/vscode-wpilib",
28-
"--extensionTestsPath=${workspaceFolder}/vscode-wpilib/out/test"
29-
],
30-
"outFiles": [
31-
"${workspaceFolder}/vscode-wpilib/out/test/**/*.js"
32-
],
33-
"preLaunchTask": "vscode-web-watch"
34-
},
35-
{
36-
"type": "node",
37-
"request": "launch",
38-
"name": "Standalone: Main",
39-
"protocol": "inspector",
40-
"runtimeExecutable": "${workspaceFolder}/wpilib-utility-standalone/node_modules/.bin/electron",
41-
"runtimeArgs": [
42-
"--remote-debugging-port=9223",
43-
"wpilib-utility-standalone"
44-
],
45-
"outFiles": [
46-
"${workspaceFolder}/wpilib-utility-standalone/out/**/*.js"
47-
],
48-
"windows": {
49-
"runtimeExecutable": "${workspaceFolder}/wpilib-utility-standalone/node_modules/.bin/electron.cmd"
50-
},
51-
"preLaunchTask": "standalone-watch"
52-
},
53-
{
54-
"name": "Standalone: Renderer",
55-
"type": "chrome",
56-
"request": "attach",
57-
"port": 9223,
58-
"webRoot": "${workspaceFolder}/wpilib-utility-standalone",
59-
"timeout": 30000
60-
}
61-
],
62-
"compounds": [
63-
{
64-
"name": "Standalone: All",
65-
"configurations": [
66-
"Standalone: Main",
67-
"Standalone: Renderer"
68-
]
69-
}
70-
]
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"runtimeExecutable": "${execPath}",
13+
"args": ["--extensionDevelopmentPath=${workspaceFolder}/vscode-wpilib"],
14+
"outFiles": ["${workspaceFolder}/vscode-wpilib/out/**/*.js"],
15+
"preLaunchTask": "vscode-web-watch"
16+
},
17+
{
18+
"name": "Extension Tests",
19+
"type": "extensionHost",
20+
"request": "launch",
21+
"runtimeExecutable": "${execPath}",
22+
"args": [
23+
"--extensionDevelopmentPath=${workspaceFolder}/vscode-wpilib",
24+
"--extensionTestsPath=${workspaceFolder}/vscode-wpilib/out/test"
25+
],
26+
"outFiles": ["${workspaceFolder}/vscode-wpilib/out/test/**/*.js"],
27+
"preLaunchTask": "vscode-web-watch"
28+
},
29+
{
30+
"type": "node",
31+
"request": "launch",
32+
"name": "Standalone: Main",
33+
"protocol": "inspector",
34+
"runtimeExecutable": "${workspaceFolder}/wpilib-utility-standalone/node_modules/.bin/electron",
35+
"runtimeArgs": [
36+
"--remote-debugging-port=9223",
37+
"wpilib-utility-standalone"
38+
],
39+
"outFiles": ["${workspaceFolder}/wpilib-utility-standalone/out/**/*.js"],
40+
"windows": {
41+
"runtimeExecutable": "${workspaceFolder}/wpilib-utility-standalone/node_modules/.bin/electron.cmd"
42+
},
43+
"preLaunchTask": "standalone-watch"
44+
},
45+
{
46+
"name": "Standalone: Renderer",
47+
"type": "chrome",
48+
"request": "attach",
49+
"port": 9223,
50+
"webRoot": "${workspaceFolder}/wpilib-utility-standalone",
51+
"timeout": 30000
52+
}
53+
],
54+
"compounds": [
55+
{
56+
"name": "Standalone: All",
57+
"configurations": ["Standalone: Main", "Standalone: Renderer"]
58+
}
59+
]
7160
}

README.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,44 @@
44

55
This repository contains the WPILib VS Code extension, along with the standalone electron project that contains some of the functionality of the extension.
66

7-
87
## Build Dependencies
9-
* Node JS - Tested with Node 18.
10-
* Java - Tested with Java 17
11-
* VS Code - For development/debugging.
12-
* TS Lint Extension
13-
* Chrome Debug Extension
14-
* In order to debug the extension, you will need the extension dependencies for the extension. The Microsoft C++ extension and the Java extension pack.
8+
9+
- Node JS - Tested with Node 18.
10+
- Java - Tested with Java 17
11+
- VS Code - For development/debugging.
12+
- TS Lint Extension
13+
- Chrome Debug Extension
14+
- In order to debug the extension, you will need the extension dependencies for the extension. The Microsoft C++ extension and the Java extension pack.
1515

1616
## Setting up Dependencies
17+
1718
In order to properly build, there is some setup that needs to occur.
19+
1820
1. Go into `vscode-wpilib` and run `npm install`
1921
2. Go into into `wpilib-utility-standalone` and run `npm install`
2022
3. From the root, run `./gradlew updateAllDependencies`. This will grab the templates and examples from WPILib, and move the shared dependencies from the vscode extension to the standalone utility. This command will need to be reran any time you update the shared dependencies in the vscode project.
2123
4. Open the root folder in VS Code.
2224

2325
## Building and Debugging
26+
2427
Once you have the project open in VS Code, there are 5 debugging targets set up.
25-
* `Extension` Will launch the extension to debug
26-
* `Extension Tests` Will launch the extension tests
27-
* `Standalone: Main` Will launch the standalone project. The debugger will be attached to the host process
28-
* `Standalone: Renderer` Will attach to the standalone projects renderer process
29-
* `Standalone: All` Will launch the standalone project, and attach to the renderer. This will attach 2 separate debuggers.
28+
29+
- `Extension` Will launch the extension to debug
30+
- `Extension Tests` Will launch the extension tests
31+
- `Standalone: Main` Will launch the standalone project. The debugger will be attached to the host process
32+
- `Standalone: Renderer` Will attach to the standalone projects renderer process
33+
- `Standalone: All` Will launch the standalone project, and attach to the renderer. This will attach 2 separate debuggers.
3034

3135
In addition, each project has a `compile` and a `lint` npm command. These will compile and lint their respective projects. Please run these before submitting any PR, as CI will check these. In addition, VS Code's lint does not detect the same lint errors as running lint manually would.
3236

3337
## Testing
38+
3439
We highly recommend you do any testing by launching in the debugger. Unlike Eclipse, local building is not required to update WPILib versions, so building files to install is not exactly a simple setup. We will be posting instructions for this later, but not currently.
3540

3641
## Warning about shared dependencies.
42+
3743
Because of limitiations in typescript, we cannot easily have a shared library that works in both the vscode extension and the standalone utility. Because VS Code is the primary platform, the files are stored in that folder. Anything in the following folder is considered shared.
38-
* `vscode-wpilib/shared`
39-
* `vscode-wpilib/riolog/shared`
40-
In these, any updates from the the standalone project will not be see in the vscode project, nor will they get committed to git. Please edit these files in the VS Code extension to apply changes.
44+
45+
- `vscode-wpilib/shared`
46+
- `vscode-wpilib/riolog/shared`
47+
In these, any updates from the the standalone project will not be see in the vscode project, nor will they get committed to git. Please edit these files in the VS Code extension to apply changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
src
2-
tsconfig.json
3-
tslint.json
1+
src
2+
tsconfig.json
3+
tslint.json
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# WPILib VSCode API
2-
3-
External API for the VS Code WPILib Extension
1+
# WPILib VSCode API
2+
3+
External API for the VS Code WPILib Extension

0 commit comments

Comments
 (0)