Skip to content

Commit 8c33968

Browse files
authored
Merge pull request #213 from olehermanse/master
GH Actions: Enabled black formatter for subfolders inside cfbs
2 parents 8eed11e + 67e1a9a commit 8c33968

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.github/workflows/black-format.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ jobs:
2323
python -m pip install black
2424
- name: Reformat with black
2525
run: |
26-
black cfbs/*.py tests/*.py > black_output.txt 2>&1
26+
shopt -s globstar
27+
black cfbs/*.py cfbs/**/*.py tests/*.py tests/**/*.py > black_output.txt 2>&1
2728
- name: Check if there are changes
2829
run: |
2930
git diff --exit-code || touch git_diff_exists
@@ -43,7 +44,8 @@ jobs:
4344
run: |
4445
git config user.name 'GitHub'
4546
git config user.email '<noreply@github.com>'
46-
git add cfbs/*.py tests/*.py
47+
shopt -s globstar
48+
git add cfbs/*.py cfbs/**/*.py tests/*.py tests/**/*.py
4749
git commit -F commit_message.txt
4850
- id: commit-message-from-file
4951
name: Parse commit message from file into variable

.github/workflows/black.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ jobs:
3030
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
3131
- name: Check formatting with black
3232
run: |
33-
black --check cfbs/*.py tests/*.py
33+
shopt -s globstar
34+
black --check cfbs/*.py cfbs/**/*.py tests/*.py tests/**/*.py

cfbs/masterfiles/generate_release_information.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ def generate_release_information(omit_download=False, check=False):
1717
else:
1818
downloaded_versions = immediate_subdirectories(DOWNLOAD_PATH)
1919

20-
print("Downloading releases of masterfiles from cfengine.com and generating release information...")
20+
print(
21+
"Downloading releases of masterfiles from cfengine.com and generating release information..."
22+
)
2123
generate_vcf_download(DOWNLOAD_PATH, downloaded_versions)
2224

2325
if check:
24-
print("Downloading releases of masterfiles from git (github.com) and generating additional release information for comparison...")
26+
print(
27+
"Downloading releases of masterfiles from git (github.com) and generating additional release information for comparison..."
28+
)
2529
generate_vcf_git_checkout(downloaded_versions)
2630
print("Candidate release information generated.")
2731
print("Comparing files from cfengine.com and github.com...")
@@ -32,4 +36,6 @@ def generate_release_information(omit_download=False, check=False):
3236
else:
3337
print("Release information successfully generated.")
3438
print("See the results in ./versions.json, ./checksums.json, and ./files.json")
35-
print("(Run again with --check-against-git to download and compare with files from git, and generate -git.json files)")
39+
print(
40+
"(Run again with --check-against-git to download and compare with files from git, and generate -git.json files)"
41+
)

0 commit comments

Comments
 (0)