Skip to content

Commit 2f7f889

Browse files
committed
chore: upgrade Prettier to v2 and run on full repo
1 parent 1f9a0c2 commit 2f7f889

27 files changed

+257
-221
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true

.eslintrc.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@
1212
"import/no-namespace": "off",
1313
"no-unused-vars": "off",
1414
"@typescript-eslint/no-unused-vars": "error",
15-
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
15+
"@typescript-eslint/explicit-member-accessibility": [
16+
"error",
17+
{"accessibility": "no-public"}
18+
],
1619
"@typescript-eslint/no-require-imports": "error",
1720
"@typescript-eslint/array-type": "error",
1821
"@typescript-eslint/await-thenable": "error",
1922
"camelcase": "off",
20-
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
23+
"@typescript-eslint/explicit-function-return-type": [
24+
"error",
25+
{"allowExpressions": true}
26+
],
2127
"@typescript-eslint/func-call-spacing": ["error", "never"],
2228
"@typescript-eslint/no-array-constructor": "error",
2329
"@typescript-eslint/no-empty-interface": "error",

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
* text=auto eol=lf
12
.licenses/** -diff linguist-generated=true

.github/workflows/codeql-analysis.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: 'CodeQL'
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
branches: [main]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main ]
19+
branches: [main]
2020
schedule:
2121
- cron: '28 9 * * 0'
2222

@@ -32,27 +32,27 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'javascript' ]
35+
language: ['javascript']
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
3737
# Learn more:
3838
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
3939

4040
steps:
41-
- name: Checkout repository
42-
uses: actions/checkout@v3
41+
- name: Checkout repository
42+
uses: actions/checkout@v3
4343

44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v1
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5252

53-
- run: npm ci
54-
- run: npm run build
55-
- run: rm -rf dist # We want code scanning to analyze lib instead (individual .js files)
53+
- run: npm ci
54+
- run: npm run build
55+
- run: rm -rf dist # We want code scanning to analyze lib instead (individual .js files)
5656

57-
- name: Perform CodeQL Analysis
58-
uses: github/codeql-action/analyze@v1
57+
- name: Perform CodeQL Analysis
58+
uses: github/codeql-action/analyze@v1

.github/workflows/licensed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v3
1313
- run: npm ci
14-
- run: npm run licensed-check
14+
- run: npm run licensed-check

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ jobs:
205205
path: basic
206206
- name: Verify basic
207207
run: __test__/verify-basic.sh --archive
208-
208+
209209
test-git-container:
210210
runs-on: ubuntu-latest
211211
container: bitnami/git:latest
@@ -242,4 +242,4 @@ jobs:
242242
- name: Fix Checkout v3
243243
uses: actions/checkout@v3
244244
with:
245-
path: v3
245+
path: v3

.github/workflows/update-main-version.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
tag:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v3
21-
with:
22-
fetch-depth: 0
23-
- name: Git config
24-
run: |
25-
git config user.name github-actions
26-
git config user.email github-actions@github.com
27-
- name: Tag new target
28-
run: git tag -f ${{ github.event.inputs.main_version }} ${{ github.event.inputs.target }}
29-
- name: Push new tag
30-
run: git push origin ${{ github.event.inputs.main_version }} --force
20+
- uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
- name: Git config
24+
run: |
25+
git config user.name github-actions
26+
git config user.email github-actions@github.com
27+
- name: Tag new target
28+
run: git tag -f ${{ github.event.inputs.main_version }} ${{ github.event.inputs.target }}
29+
- name: Push new tag
30+
run: git push origin ${{ github.event.inputs.main_version }} --force

.licensed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ allowed:
1111
- unlicense
1212

1313
reviewed:
14-
npm:
14+
npm:

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dist/
22
lib/
3-
node_modules/
3+
node_modules/
4+
.licenses/

.prettierrc.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
"singleQuote": true,
77
"trailingComma": "none",
88
"bracketSpacing": false,
9-
"arrowParens": "avoid",
10-
"parser": "typescript"
11-
}
9+
"arrowParens": "avoid"
10+
}

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Changelog
22

33
## v3.1.0
4+
45
- [Use @actions/core `saveState` and `getState`](https://github.com/actions/checkout/pull/939)
56
- [Add `github-server-url` input](https://github.com/actions/checkout/pull/922)
67

78
## v3.0.2
9+
810
- [Add input `set-safe-directory`](https://github.com/actions/checkout/pull/770)
911

1012
## v3.0.1
13+
1114
- [Fixed an issue where checkout failed to run in container jobs due to the new git setting `safe.directory`](https://github.com/actions/checkout/pull/762)
1215
- [Bumped various npm package versions](https://github.com/actions/checkout/pull/744)
1316

@@ -66,7 +69,6 @@
6669
- Aligns better with container actions, where `github.workspace` gets mapped in
6770
- Removed input `submodules`
6871

69-
7072
## v1
7173

7274
Refer [here](https://github.com/actions/checkout/blob/v1/CHANGELOG.md) for the V1 changelog

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
1818
# Usage
1919

2020
<!-- start usage -->
21+
2122
```yaml
2223
- uses: actions/checkout@v3
2324
with:
@@ -102,6 +103,7 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
102103
# https://my-ghes-server.example.com
103104
github-server-url: ''
104105
```
106+
105107
<!-- end usage -->
106108
107109
# Scenarios
@@ -187,7 +189,6 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
187189
188190
> - `${{ github.token }}` is scoped to the current repository, so if you want to checkout a different repository that is private you will need to provide your own [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
189191

190-
191192
## Checkout pull request HEAD commit instead of merge commit
192193

193194
```yaml

__test__/git-auth-helper.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ describe('git-auth-helper tests', () => {
169169

170170
// Mock fs.promises.readFile
171171
const realReadFile = fs.promises.readFile
172-
jest.spyOn(fs.promises, 'readFile').mockImplementation(
173-
async (file: any, options: any): Promise<Buffer> => {
172+
jest
173+
.spyOn(fs.promises, 'readFile')
174+
.mockImplementation(async (file: any, options: any): Promise<Buffer> => {
174175
const userKnownHostsPath = path.join(
175176
os.homedir(),
176177
'.ssh',
@@ -181,8 +182,7 @@ describe('git-auth-helper tests', () => {
181182
}
182183

183184
return await realReadFile(file, options)
184-
}
185-
)
185+
})
186186

187187
// Act
188188
const authHelper = gitAuthHelper.createAuthHelper(git, settings)

__test__/ref-helper.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ let git: IGitCommandManager
77

88
describe('ref-helper tests', () => {
99
beforeEach(() => {
10-
git = ({} as unknown) as IGitCommandManager
10+
git = {} as unknown as IGitCommandManager
1111
})
1212

1313
it('getCheckoutInfo requires git', async () => {
14-
const git = (null as unknown) as IGitCommandManager
14+
const git = null as unknown as IGitCommandManager
1515
try {
1616
await refHelper.getCheckoutInfo(git, 'refs/heads/my/branch', commit)
1717
throw new Error('Should not reach here')

__test__/retry-helper.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('retry-helper tests', () => {
6868

6969
it('all attempts fail succeeds', async () => {
7070
let attempts = 0
71-
let error: Error = (null as unknown) as Error
71+
let error: Error = null as unknown as Error
7272
try {
7373
await retryHelper.execute(() => {
7474
throw new Error(`some error ${++attempts}`)

0 commit comments

Comments
 (0)