Skip to content

Commit

Permalink
Merge pull request #29 from VatsalJagani/ruff-issue-fixes
Browse files Browse the repository at this point in the history
Python formatting issues fixed.
  • Loading branch information
VatsalJagani authored Mar 8, 2024
2 parents 186dbe9 + 4ac9fab commit 684d015
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/py_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ jobs:
- name: Run Python Unit Tests
run: pytest tests --junitxml=junit/test-results.xml --cov=src --cov-config=tests/.coveragerc --cov-report=xml

- name: Linting with Ruff
run: ruff --output-format=github .
continue-on-error: true # need to remove this later on to catch the errors anf fail the workflow on linting errors

- name: Adding GitHub action step summary
uses: VatsalJagani/[email protected]
with:
pytest_results_file: "junit/test-results.xml"
pytest_cov_file: "coverage.xml"

- name: Linting with Ruff
run: ruff --output-format=github .
# continue-on-error: true # need to remove this later on to catch the errors anf fail the workflow on linting errors

4 changes: 2 additions & 2 deletions src/app_build_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def file_folder_permission_changes():

for file_ext in [".sh", ".exe", ".cmd", ".msi", ".bat"]:
utils.execute_system_command(
"find . -type f -name '*{}' -exec chmod 755 '{}' \;".format(file_ext))
f"find . -type f -name '*{file_ext}' -exec chmod 755 '{{}}' \;")

utils.execute_system_command(
"find . -type d -exec chmod 755 '{}' \;")
Expand All @@ -40,7 +40,7 @@ def run_custom_user_defined_commands():
if cmd:
utils.execute_system_command(cmd)
except Exception as e:
utils.warning("Error ")
utils.warning(f"Error - {e}")


def generate_build(app_build_dir_name, app_build_dir_path):
Expand Down
5 changes: 3 additions & 2 deletions src/app_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ def __init__(self, app_build_path) -> None:

try:
shutil.rmtree(self.app_inspect_report_dir)
except:
pass # nothing to delete if folder not exist
except Exception as e:
# nothing to delete if folder not exist
utils.debug(f"No folder present nothing to be done. {e}")
os.mkdir(self.app_inspect_report_dir)

self.headers = None
Expand Down
1 change: 0 additions & 1 deletion src/app_utilities.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

import os
import shutil
import helpers.github_action_utils as utils
from utilities.whats_inside_app import WhatsInsideTheAppUtility
from utilities.logger import LoggerUtility
Expand Down
1 change: 0 additions & 1 deletion src/helpers/git_manager.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

import os
import re
import subprocess
import hashlib
import helpers.github_action_utils as utils

Expand Down
6 changes: 3 additions & 3 deletions src/helpers/github_action_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ def group(title):


def end_group():
print(f"::endgroup::")
print("::endgroup::")


def add_mask(value):
print(f"::add-mask::{_escape_data(value)}")


def stop_commands():
print(f"::stop-commands::pause-commands")
print("::stop-commands::pause-commands")


def resume_commands():
print(f"::pause-commands::")
print("::pause-commands::")


def save_state(name, value):
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/global_variables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os, re
import os
import re


class GlobalVariables:
Expand Down

0 comments on commit 684d015

Please sign in to comment.