Skip to content

Commit 8bb913f

Browse files
committed
Add pre-commit configuration with basic hooks
1 parent dc2b5f2 commit 8bb913f

22 files changed

+31
-22
lines changed

.github/workflows/lint_pr_title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
steps:
2222
- uses: amannn/action-semantic-pull-request@e9fabac35e210fea40ca5b14c0da95a099eff26f # v5
2323
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Check if all dependencies were commited
3030
shell: bash
3131
run: |
32-
if [ "$(git status --porcelain)" ]; then
32+
if [ "$(git status --porcelain)" ]; then
3333
git status
3434
exit 1
3535
else

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
*.swp
1919

2020
# IDE
21-
.idea/
21+
.idea/

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/golangci/golangci-lint/
3+
rev: v1.59.1
4+
hooks:
5+
- id: golangci-lint
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v2.3.0
8+
hooks:
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The code have run login in `cmd/codegen` directory, to run it with default optio
3333
go run cmd/codegen/main.go
3434
```
3535
This command can be parametrizes using options:
36-
- `-t/-type` - operation type, default is to create both Terraform
36+
- `-t/-type` - operation type, default is to create both Terraform
3737
- `mktp` - create only Terraform provider
3838
- `mksdk` - create only PAN-OS SDK
3939
- `config` - specify path for the config file, default is `cmd/codegen/config.yaml`
@@ -47,4 +47,4 @@ example code:
4747
go run cmd/codegen/main.go -t mksdk
4848
cd ../generated/pango
4949
PANOS_HOSTNAME='***' PANOS_USERNAME='***' PANOS_PASSWORD='***' go run example/main.go
50-
```
50+
```

SUPPORT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ This template/script/solution is released “as-is”, with no warranty and no s
44
supported and Palo Alto Networks may contribute its expertise at its discretion. Palo Alto Networks, including through
55
its Authorized Support Centers (ASC) partners and backline support options, will not provide technical support or help
66
in using or troubleshooting this template/script/solution. The underlying product used by this template/script/solution
7-
will still be supported in accordance with the product’s applicable support policy and the customer’s entitlements.
7+
will still be supported in accordance with the product’s applicable support policy and the customer’s entitlements.

pkg/translate/terraform_provider/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (r *{{ structName }}) Configure(ctx context.Context, req resource.Configure
8888
}
8989
9090
r.client = req.ProviderData.(*pango.XmlApiClient)
91-
91+
9292
//TODO: There should be some error handling
9393
//if !ok {
9494
// resp.Diagnostics.AddError(

specs/network/interface/ethernet.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,4 @@ spec:
243243
min: 40
244244
max: 300
245245
profiles:
246-
- xpath: [ "ipv6-mss-adjustment" ]
246+
- xpath: [ "ipv6-mss-adjustment" ]

specs/network/interface/loopback.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,3 @@ spec:
152152
max: 300
153153
profiles:
154154
- xpath: [ "ipv6-mss-adjustment" ]
155-

specs/network/profiles/interface-management-profile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ spec:
125125
type: string
126126
profiles:
127127
- type: entry
128-
xpath: [ "permitted-ip" ]
128+
xpath: [ "permitted-ip" ]

0 commit comments

Comments
 (0)