Skip to content

Commit b38d42a

Browse files
committed
Merge branch 'main' into jabaile/gofumpt-go-tool
2 parents 659362b + 1da2605 commit b38d42a

File tree

21,984 files changed

+345179
-348009
lines changed

Some content is hidden

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

21,984 files changed

+345179
-348009
lines changed

.custom-gcl.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/custom-gcl.jsonschema.json
22

3-
version: v1.64.6
3+
version: v2.0.2
44

55
destination: ./_tools
66

.github/actions/setup-go/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ runs:
1414
steps:
1515
- name: Install Go
1616
id: install-go
17-
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
17+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
1818
with:
1919
go-version: ${{ inputs.go-version }}
2020
cache: false
2121

2222
- name: Go cache
23-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
23+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
2424
with:
2525
# There is more code downloaded and built than is covered by '**/go.sum',
2626
# so give each job its own cache to try and not end up sharing the wrong

.github/codecov.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
comment: false
2+
3+
coverage:
4+
precision: 5
5+
status:
6+
patch:
7+
default:
8+
informational: true
9+
project:
10+
default:
11+
informational: true
12+
13+
github_checks:
14+
annotations: false

.github/workflows/ci.yml

+91-11
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,27 @@ jobs:
3131

3232
- run: npx hereby build
3333

34+
extension:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
39+
40+
- run: npm ci
41+
42+
- run: npm run extension:build
43+
3444
test:
3545
strategy:
3646
fail-fast: false
3747
matrix:
3848
include:
3949
- os: ubuntu-latest
50+
coverage: true
4051
- os: windows-latest
52+
coverage: true
4153
- os: macos-latest
54+
coverage: true
4255
- os: ubuntu-latest
4356
name: 'no submodules'
4457
no-submodules: true
@@ -50,12 +63,23 @@ jobs:
5063
noembed: true
5164
- os: ubuntu-latest
5265
name: 'concurrent test programs'
53-
concurrent-test-program: true
66+
concurrent-test-programs: true
67+
coverage: true
5468

5569
name: test (${{ matrix.name || matrix.os }})
5670

5771
runs-on: ${{ matrix.os }}
5872

73+
permissions:
74+
id-token: write
75+
contents: read
76+
77+
env:
78+
TSGO_HEREBY_RACE: ${{ (matrix.race && 'true') || 'false' }}
79+
TSGO_HEREBY_NOEMBED: ${{ (matrix.noembed && 'true') || 'false' }}
80+
TSGO_HEREBY_CONCURRENT_TEST_PROGRAMS: ${{ (matrix.concurrent-test-programs && 'true') || 'false' }}
81+
TSGO_HEREBY_COVERAGE: ${{ (matrix.coverage && 'true') || 'false' }}
82+
5983
steps:
6084
- run: git config --system core.longpaths true
6185
if: ${{ matrix.os == 'windows-latest' }}
@@ -79,13 +103,17 @@ jobs:
79103

80104
- name: Tests
81105
id: test
82-
run: npx hereby test:all ${RACE_FLAG:+"$RACE_FLAG"} ${NOEMBED_FLAG:+"$NOEMBED_FLAG"} ${CONCURRENTTESTPROGRAM_FLAG:+"$CONCURRENTTESTPROGRAM_FLAG"}
83-
env:
84-
RACE_FLAG: ${{ (matrix.race && '--race') || '' }}
85-
NOEMBED_FLAG: ${{ (matrix.noembed && '--noembed') || '' }}
86-
CONCURRENTTESTPROGRAM_FLAG: ${{ (matrix.concurrent-test-program && '--concurrentTestPrograms') || '' }}
106+
run: npx hereby test:all
87107

88108
- run: git add .
109+
110+
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
111+
if: ${{ always() && matrix.coverage }}
112+
with:
113+
use_oidc: true
114+
name: ${{ matrix.name || matrix.os }}
115+
directory: ./coverage
116+
89117
- run: git diff --staged --exit-code --stat
90118

91119
- name: Print baseline diff on failure
@@ -94,7 +122,7 @@ jobs:
94122
npx hereby baseline-accept
95123
git add testdata/baselines/reference
96124
git diff --staged --exit-code
97-
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
125+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
98126
if: ${{ failure() && steps.test.conclusion == 'failure' }}
99127
with:
100128
name: ${{ matrix.os }}-${{ (matrix.race && 'race') || 'norace' }}-new-baselines-artifact
@@ -116,6 +144,9 @@ jobs:
116144

117145
runs-on: ${{ matrix.os }}
118146

147+
env:
148+
TSGO_HEREBY_NOEMBED: ${{ (matrix.noembed && 'true') || 'false' }}
149+
119150
steps:
120151
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
121152
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
@@ -125,10 +156,7 @@ jobs:
125156

126157
- run: npm ci
127158

128-
- run: npx hereby install-tools
129-
- run: npx hereby lint ${NOEMBED_FLAG:+"$NOEMBED_FLAG"}
130-
env:
131-
NOEMBED_FLAG: ${{ (matrix.noembed && '--noembed') || '' }}
159+
- run: npx hereby lint
132160

133161
format:
134162
runs-on: ubuntu-latest
@@ -204,6 +232,58 @@ jobs:
204232

205233
- run: go -C ./_tools run ./cmd/checkmodpaths $PWD
206234

235+
baselines:
236+
runs-on: ubuntu-latest
237+
steps:
238+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
239+
with:
240+
submodules: true
241+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
242+
- uses: ./.github/actions/setup-go
243+
with:
244+
cache-name: baselines
245+
246+
- run: npm ci
247+
248+
- name: Remove all baselines
249+
run: rm -rf testdata/baselines/reference
250+
251+
- name: Run tests
252+
run: npx hereby test &> /dev/null || exit 0
253+
254+
- name: Accept baselines
255+
run: |
256+
npx hereby baseline-accept
257+
git add testdata/baselines/reference
258+
259+
- name: Run tests
260+
run: npx hereby test
261+
262+
- name: Check baselines
263+
id: check-baselines
264+
run: |
265+
function print_diff() {
266+
if ! git diff --staged --exit-code --quiet --diff-filter=$1; then
267+
echo "$2:"
268+
git diff --staged --name-only --diff-filter=$1
269+
fi
270+
}
271+
272+
if ! git diff --staged --exit-code --quiet; then
273+
print_diff ACR "Missing baselines"
274+
print_diff MTUXB "Modified baselines"
275+
print_diff D "Unused baselines"
276+
git diff --staged > fix_baselines.patch
277+
exit 1
278+
fi
279+
280+
- name: Upload baseline diff artifact
281+
if: ${{ failure() && steps.check-baselines.conclusion == 'failure' }}
282+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
283+
with:
284+
name: fix_baselines.patch
285+
path: fix_baselines.patch
286+
207287
required:
208288
runs-on: ubuntu-latest
209289
if: ${{ always() }}

.github/workflows/codeql.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
# Initializes the CodeQL tools for scanning.
5050
- name: Initialize CodeQL
51-
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
51+
uses: github/codeql-action/init@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14
5252
with:
5353
config-file: ./.github/codeql/codeql-configuration.yml
5454
# Override language selection by uncommenting this and choosing your languages
@@ -58,7 +58,7 @@ jobs:
5858
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5959
# If this step fails, then you should remove it and run the build manually (see below).
6060
- name: Autobuild
61-
uses: github/codeql-action/autobuild@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
61+
uses: github/codeql-action/autobuild@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14
6262

6363
# ℹ️ Command-line programs to run using the OS shell.
6464
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -72,4 +72,4 @@ jobs:
7272
# make release
7373

7474
- name: Perform CodeQL Analysis
75-
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
75+
uses: github/codeql-action/analyze@fc7e4a0fa01c3cca5fd6a1fddec5c0740c977aa2 # v3.28.14

.gitmodules

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "_submodules/TypeScript"]
22
path = _submodules/TypeScript
33
url = https://github.com/microsoft/TypeScript.git
4+
branch = tsgo-port

.golangci.yml

+15-24
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json
22

3+
version: '2'
4+
35
run:
46
allow-parallel-runners: true
5-
timeout: 180s
67

78
linters:
8-
disable-all: true
9+
default: none
910
enable:
1011
# Enabled
1112
- asasalint
12-
- inamedparam
13-
- nakedret
14-
- govet
1513
- bidichk
1614
- bodyclose
1715
- canonicalheader
1816
- copyloopvar
17+
- customlint
1918
- durationcheck
2019
- errcheck
2120
- errchkjson
@@ -24,14 +23,16 @@ linters:
2423
- fatcontext
2524
- gocheckcompilerdirectives
2625
- goprintffuncname
27-
- gosimple
26+
- govet
2827
- grouper
28+
- inamedparam
2929
- ineffassign
3030
- intrange
3131
- makezero
3232
- mirror
3333
- misspell
3434
- musttag
35+
- nakedret
3536
- nolintlint
3637
- paralleltest
3738
- perfsprint
@@ -42,9 +43,6 @@ linters:
4243
- unconvert
4344
- usestdlibvars
4445
- usetesting
45-
- whitespace
46-
47-
- customlint
4846

4947
# Need to add headers
5048
# - goheader
@@ -55,27 +53,20 @@ linters:
5553
# - gosec
5654
# - revive
5755
# - staticcheck
58-
# - stylecheck
5956
# - testifylint
6057
# - unparam
6158
# - unused
6259

63-
linters-settings:
64-
custom:
65-
customlint:
66-
type: module
60+
settings:
61+
custom:
62+
customlint:
63+
type: module
6764

68-
# revive:
69-
# enable-all-rules: true
70-
# rules:
71-
# - name: unused-parameter
72-
# disabled: true
65+
exclusions:
66+
presets:
67+
- comments
68+
- std-error-handling
7369

7470
issues:
7571
max-issues-per-linter: 0
7672
max-same-issues: 0
77-
78-
exclude:
79-
- '^could not import'
80-
- '^: #'
81-
- 'imported and not used$'

0 commit comments

Comments
 (0)