Skip to content

Commit 10e2d0d

Browse files
committed
integrate pre-commit hooks
1 parent 9156ba4 commit 10e2d0d

File tree

10 files changed

+29
-15
lines changed

10 files changed

+29
-15
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ module.exports = {
1111
"ecmaVersion":"latest"
1212
},
1313
"rules":{
14-
14+
1515
}
1616
}

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242

4343
- name: Log when unchanged
4444
if: steps.check.outputs.changed == 'false'
45-
run: 'echo "No version change :/"'
45+
run: 'echo "No version change :/"'

.github/workflows/package-audit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
git-pr-title: "[SECURITY] NPM audit fix"
3232
git-branch: npm-audit-action
3333
git-remote: origin
34-
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
3535
- name: outdated version
3636
uses: ycjcl868/outdated-version-action@v1
3737
with:
38-
token: ${{ secrets.GITHUB_TOKEN }}
38+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ coverage
1313

1414
# Serverless directories
1515
.serverless
16-
.eslintcache
16+
.eslintcache

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.3.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- id: check-json
12+
- id: detect-private-key
13+
- id: pretty-format-json
14+
args: [ --autofix, --no-sort-keys ]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
Automatically creates AWS CloudFront distribution and Route 53 records to AWS Lambda with [Function URL](https://aws.amazon.com/fr/blogs/aws/announcing-aws-lambda-function-urls-built-in-https-endpoints-for-single-function-microservices/) (no api gateway).
99

10-
## Installation
10+
## Installation
1111
```bash
1212
npm install --save-dev serverless-aws-function-url-custom-domain
1313
```
@@ -20,15 +20,15 @@ This plugin assumes your domain is hosted and managed with AWS Route53. SSL cert
2020

2121
plugins:
2222
- serverless-aws-function-url-custom-domain
23-
23+
2424

2525
custom:
2626
urlDomain:
27-
domains:
27+
domains:
2828
- ${env:SUBDOMAIN}.yourdomain.com # custom domain 1
2929
- ${env:SUBDOMAIN}-alt.yourdomain.com # custom domain 2
3030
hostedZoneName: yourdomain.com. # your domain Route 53 hosted zone name
31-
certificateArn: 'arn:aws:acm:us-east-1:xxxxx:certificate/xxxxx' # need to be located at NVirgina
31+
certificateArn: 'arn:aws:acm:us-east-1:xxxxx:certificate/xxxxx' # need to be located at NVirgina
3232
route53: false # disable route 53 integration
3333
functions:
3434
api:
@@ -67,10 +67,10 @@ More specifically this plugin needs the following policies attached:
6767
* `cloudfront:UpdateDistribution`
6868
* `cloudfront:DeleteDistribution`
6969
* `cloudfront:TagResource`
70-
* `route53:ListHostedZones`
70+
* `route53:ListHostedZones`
7171
* `route53:ChangeResourceRecordSets`
7272
* `route53:GetHostedZone`
73-
* `route53:ListResourceRecordSets`
73+
* `route53:ListResourceRecordSets`
7474
* `acm:ListCertificates`
7575

7676
You can read more about IAM profiles and policies in the [Serverless documentation](https://serverless.com/framework/docs/providers/aws/guide/credentials#creating-aws-access-keys).

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ServerlessAWSFunctionURLCustomDomainPlugin {
2929
this.serverless.cli.consoleLog("no function url defined");
3030
return baseResources;
3131
}
32-
32+
3333
const config = this.serverless.service.custom.urlDomain;
3434
config['lambdaFunctionUrl'] = functionURLResourceName
3535

index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ describe('Array', function () {
1616

1717
});
1818
});
19-
});
19+
});

resources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ Resources:
5151
Outputs:
5252
CloudFrontDistributionDomain:
5353
Value:
54-
Fn::GetAtt: [ CloudFrontDistribution, DomainName ]
54+
Fn::GetAtt: [ CloudFrontDistribution, DomainName ]

0 commit comments

Comments
 (0)