Skip to content

Commit

Permalink
remove code formatter workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tamsinforbes committed Apr 22, 2024
1 parent c64881a commit c156381
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/format-code.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/python-malformed-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- name: Checkout repo
uses: actions/[email protected]
- name: Detect malformed yaml files
- name: Detect malformed YAML files
uses: ministryofjustice/github-actions/python-malformed-yaml@mal-yaml-to-python
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 6 additions & 3 deletions python-malformed-yaml/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def get_malformed_yaml_files_and_errors(yaml_files: list[str]) -> list[str]:
malformed_yaml_files_and_errors.append(f"\n{str(y)}:\n{str(exc)}")
return malformed_yaml_files_and_errors

def message(files_and_errors: list):
def malformed_yaml_files_message(files_and_errors: list):
"""
Compose message to display in the PR.
"""
msg = "😱 The following malformed YAML files and related errors were found:\n"
msg += "\n".join(files_and_errors)
return msg
Expand All @@ -70,11 +73,11 @@ def main():
changed_yaml_files = get_changed_yaml_files_from_pr()
malformed_yaml_files = get_malformed_yaml_files_and_errors(changed_yaml_files)
if malformed_yaml_files:
msg = message(malformed_yaml_files)
msg = malformed_yaml_files_message(malformed_yaml_files)
github.fail_pr(message=msg)
print(msg)
return True
else:
else:
print("PR YAML files all OK!")
return False

Expand Down

0 comments on commit c156381

Please sign in to comment.