Skip to content

Commit a9077b1

Browse files
authored
Added pre-commit for dev (#77)
1 parent ab105c2 commit a9077b1

25 files changed

Lines changed: 51 additions & 24 deletions

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
sudo apt-get update
3030
3131
- name: Git LFS Pull for deployment
32-
run: |
32+
run: |
3333
echo "Pulling all Git LFS"
3434
git lfs pull -I **/challenges/**/ansible/**/*
3535

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ challenges/*/terraform/versions.tf
1919

2020
.vscode/
2121
.idea
22-
stats.html
22+
stats.html

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
8+
- repo: local
9+
hooks:
10+
- id: format
11+
name: Format
12+
entry: ruff format
13+
language: python
14+
pass_filenames: false
15+
additional_dependencies: [ruff]
16+
- id: fix-imports
17+
name: Fix imports
18+
entry: ruff check --fix --show-fixes
19+
language: python
20+
pass_filenames: false
21+
additional_dependencies: [ruff]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ tree until it finds `challenges/` and `.deploy` directories, which is the root o
3232
```raw
3333
my-ctf/
3434
├── challenges/ # Directory containing all the tracks
35-
│ ├── track1/ # Directory for a specific track that contains N flags.
35+
│ ├── track1/ # Directory for a specific track that contains N flags.
3636
│ │ ├── track.yaml # Main file that describes the track
3737
│ │ ├── files/ # Directory that contains all the files available for download in the track
3838
│ │ │ ├── somefile.zip
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?php echo 'Hello world!'; ?>
2-
<!-- {{ track_flags.mock_track_apache_php_flag_1 }} -->
2+
<!-- {{ track_flags.mock_track_apache_php_flag_1 }} -->

challenges/mock-track-apache-php/posts/mock-track-apache-php-flag1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ api:
77
user: nsec
88
title: "Mock Track Apache PHP"
99
body: |-
10-
Mock Track Apache PHP body.
10+
Mock Track Apache PHP body.

challenges/mock-track-apache-php/posts/mock-track-apache-php.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ api:
33
user: nsec
44
title: "Mock Track Apache PHP body."
55
body: |-
6-
Mock Track Apache PHP body.
6+
Mock Track Apache PHP body.

challenges/mock-track-files-only/posts/mock-track-files-only-flag1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ api:
77
user: nsec
88
title: "Mock Track Files Only"
99
body: |-
10-
Mock Track Files Only body
10+
Mock Track Files Only body

challenges/mock-track-files-only/posts/mock-track-files-only.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ api:
33
user: nsec
44
title: "Mock Track Files Only"
55
body: |-
6-
Mock Track Files Only body
6+
Mock Track Files Only body

challenges/mock-track-python-service/posts/mock-track-python-service-flag1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ api:
77
user: nsec
88
title: "Mock Track Python Service"
99
body: |-
10-
Mock Track Python Service body
10+
Mock Track Python Service body

0 commit comments

Comments
 (0)