Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH Actions: Enabled black formatter for subfolders inside cfbs #213

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)"
)
Loading