Skip to content

Commit 2eba129

Browse files
committed
chore: upgrade Prettier to v2 and run on full repo
1 parent 230611d commit 2eba129

24 files changed

+233
-201
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@v2
41+
- name: Checkout repository
42+
uses: actions/checkout@v2
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@v2
1313
- run: npm ci
14-
- run: npm run licensed-check
14+
- run: npm run licensed-check

.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: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
- [Fix default branch resolution for .wiki and when using SSH](https://github.com/actions/checkout/pull/284)
66

7-
87
## v2.3.0
98

109
- [Fallback to the default branch](https://github.com/actions/checkout/pull/278)
@@ -52,7 +51,6 @@
5251
- Aligns better with container actions, where `github.workspace` gets mapped in
5352
- Removed input `submodules`
5453

55-
5654
## v1
5755

5856
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
@@ -33,6 +33,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous
3333
# Usage
3434

3535
<!-- start usage -->
36+
3637
```yaml
3738
- uses: actions/checkout@v2
3839
with:
@@ -106,6 +107,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous
106107
# Default: false
107108
submodules: ''
108109
```
110+
109111
<!-- end usage -->
110112
111113
# Scenarios
@@ -191,7 +193,6 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous
191193
192194
> - `${{ 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).
193195

194-
195196
## Checkout pull request HEAD commit instead of merge commit
196197

197198
```yaml

__test__/git-auth-helper.test.ts

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

138138
// Mock fs.promises.readFile
139139
const realReadFile = fs.promises.readFile
140-
jest.spyOn(fs.promises, 'readFile').mockImplementation(
141-
async (file: any, options: any): Promise<Buffer> => {
140+
jest
141+
.spyOn(fs.promises, 'readFile')
142+
.mockImplementation(async (file: any, options: any): Promise<Buffer> => {
142143
const userKnownHostsPath = path.join(
143144
os.homedir(),
144145
'.ssh',
@@ -149,8 +150,7 @@ describe('git-auth-helper tests', () => {
149150
}
150151

151152
return await realReadFile(file, options)
152-
}
153-
)
153+
})
154154

155155
// Act
156156
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}`)

action.yml

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
1-
name: 'Checkout'
2-
description: 'Checkout a Git repository at a particular version'
3-
inputs:
4-
repository:
5-
description: 'Repository name with owner. For example, actions/checkout'
6-
default: ${{ github.repository }}
7-
ref:
8-
description: >
9-
The branch, tag or SHA to checkout. When checking out the repository that
10-
triggered a workflow, this defaults to the reference or SHA for that
11-
event. Otherwise, uses the default branch.
12-
token:
13-
description: >
14-
Personal access token (PAT) used to fetch the repository. The PAT is configured
15-
with the local git config, which enables your scripts to run authenticated git
16-
commands. The post-job step removes the PAT.
17-
18-
19-
We recommend using a service account with the least permissions necessary.
20-
Also when generating a new PAT, select the least scopes necessary.
21-
22-
23-
[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
24-
default: ${{ github.token }}
25-
ssh-key:
26-
description: >
27-
SSH key used to fetch the repository. The SSH key is configured with the local
28-
git config, which enables your scripts to run authenticated git commands.
29-
The post-job step removes the SSH key.
30-
31-
32-
We recommend using a service account with the least permissions necessary.
33-
34-
35-
[Learn more about creating and using
36-
encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
37-
ssh-known-hosts:
38-
description: >
39-
Known hosts in addition to the user and global host key database. The public
40-
SSH keys for a host may be obtained using the utility `ssh-keyscan`. For example,
41-
`ssh-keyscan github.com`. The public key for github.com is always implicitly added.
42-
ssh-strict:
43-
description: >
44-
Whether to perform strict host key checking. When true, adds the options `StrictHostKeyChecking=yes`
45-
and `CheckHostIP=no` to the SSH command line. Use the input `ssh-known-hosts` to
46-
configure additional hosts.
47-
default: true
48-
persist-credentials:
49-
description: 'Whether to configure the token or SSH key with the local git config'
50-
default: true
51-
path:
52-
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
53-
clean:
54-
description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
55-
default: true
56-
fetch-depth:
57-
description: 'Number of commits to fetch. 0 indicates all history for all branches and tags.'
58-
default: 1
59-
lfs:
60-
description: 'Whether to download Git-LFS files'
61-
default: false
62-
submodules:
63-
description: >
64-
Whether to checkout submodules: `true` to checkout submodules or `recursive` to
65-
recursively checkout submodules.
66-
67-
68-
When the `ssh-key` input is not provided, SSH URLs beginning with `git@github.com:` are
69-
converted to HTTPS.
70-
default: false
71-
runs:
72-
using: node12
73-
main: dist/index.js
74-
post: dist/index.js
1+
name: 'Checkout'
2+
description: 'Checkout a Git repository at a particular version'
3+
inputs:
4+
repository:
5+
description: 'Repository name with owner. For example, actions/checkout'
6+
default: ${{ github.repository }}
7+
ref:
8+
description: >
9+
The branch, tag or SHA to checkout. When checking out the repository that
10+
triggered a workflow, this defaults to the reference or SHA for that
11+
event. Otherwise, uses the default branch.
12+
token:
13+
description: >
14+
Personal access token (PAT) used to fetch the repository. The PAT is configured
15+
with the local git config, which enables your scripts to run authenticated git
16+
commands. The post-job step removes the PAT.
17+
18+
19+
We recommend using a service account with the least permissions necessary.
20+
Also when generating a new PAT, select the least scopes necessary.
21+
22+
23+
[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
24+
default: ${{ github.token }}
25+
ssh-key:
26+
description: >
27+
SSH key used to fetch the repository. The SSH key is configured with the local
28+
git config, which enables your scripts to run authenticated git commands.
29+
The post-job step removes the SSH key.
30+
31+
32+
We recommend using a service account with the least permissions necessary.
33+
34+
35+
[Learn more about creating and using
36+
encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
37+
ssh-known-hosts:
38+
description: >
39+
Known hosts in addition to the user and global host key database. The public
40+
SSH keys for a host may be obtained using the utility `ssh-keyscan`. For example,
41+
`ssh-keyscan github.com`. The public key for github.com is always implicitly added.
42+
ssh-strict:
43+
description: >
44+
Whether to perform strict host key checking. When true, adds the options `StrictHostKeyChecking=yes`
45+
and `CheckHostIP=no` to the SSH command line. Use the input `ssh-known-hosts` to
46+
configure additional hosts.
47+
default: true
48+
persist-credentials:
49+
description: 'Whether to configure the token or SSH key with the local git config'
50+
default: true
51+
path:
52+
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
53+
clean:
54+
description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
55+
default: true
56+
fetch-depth:
57+
description: 'Number of commits to fetch. 0 indicates all history for all branches and tags.'
58+
default: 1
59+
lfs:
60+
description: 'Whether to download Git-LFS files'
61+
default: false
62+
submodules:
63+
description: >
64+
Whether to checkout submodules: `true` to checkout submodules or `recursive` to
65+
recursively checkout submodules.
66+
67+
68+
When the `ssh-key` input is not provided, SSH URLs beginning with `git@github.com:` are
69+
converted to HTTPS.
70+
default: false
71+
runs:
72+
using: node12
73+
main: dist/index.js
74+
post: dist/index.js

0 commit comments

Comments
 (0)