Skip to content

Commit

Permalink
Merge pull request #213 from olehermanse/master
Browse files Browse the repository at this point in the history
GH Actions: Enabled black formatter for subfolders inside cfbs
  • Loading branch information
olehermanse authored Nov 28, 2024
2 parents 8eed11e + 67e1a9a commit 8c33968
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/black-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
python -m pip install black
- name: Reformat with black
run: |
black cfbs/*.py tests/*.py > black_output.txt 2>&1
shopt -s globstar
black cfbs/*.py cfbs/**/*.py tests/*.py tests/**/*.py > black_output.txt 2>&1
- name: Check if there are changes
run: |
git diff --exit-code || touch git_diff_exists
Expand All @@ -43,7 +44,8 @@ jobs:
run: |
git config user.name 'GitHub'
git config user.email '<noreply@github.com>'
git add cfbs/*.py tests/*.py
shopt -s globstar
git add cfbs/*.py cfbs/**/*.py tests/*.py tests/**/*.py
git commit -F commit_message.txt
- id: commit-message-from-file
name: Parse commit message from file into variable
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Check formatting with black
run: |
black --check cfbs/*.py tests/*.py
shopt -s globstar
black --check cfbs/*.py cfbs/**/*.py tests/*.py tests/**/*.py
12 changes: 9 additions & 3 deletions cfbs/masterfiles/generate_release_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ def generate_release_information(omit_download=False, check=False):
else:
downloaded_versions = immediate_subdirectories(DOWNLOAD_PATH)

print("Downloading releases of masterfiles from cfengine.com and generating release information...")
print(
"Downloading releases of masterfiles from cfengine.com and generating release information..."
)
generate_vcf_download(DOWNLOAD_PATH, downloaded_versions)

if check:
print("Downloading releases of masterfiles from git (github.com) and generating additional release information for comparison...")
print(
"Downloading releases of masterfiles from git (github.com) and generating additional release information for comparison..."
)
generate_vcf_git_checkout(downloaded_versions)
print("Candidate release information generated.")
print("Comparing files from cfengine.com and github.com...")
Expand All @@ -32,4 +36,6 @@ def generate_release_information(omit_download=False, check=False):
else:
print("Release information successfully generated.")
print("See the results in ./versions.json, ./checksums.json, and ./files.json")
print("(Run again with --check-against-git to download and compare with files from git, and generate -git.json files)")
print(
"(Run again with --check-against-git to download and compare with files from git, and generate -git.json files)"
)

0 comments on commit 8c33968

Please sign in to comment.