Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
laysauchoa authored and angelinekwan committed Dec 27, 2022
1 parent 92847b3 commit 50e1abb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/redirect_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
done
echo "$var"
if ! [ -z "$var" ];then
python "scripts/aiven/check_renamed_files.py" --renamed_files ${{ steps.changed-files.outputs.renamed_files }}
python "scripts/check_renamed_files.py" --renamed_files ${{ steps.changed-files.outputs.renamed_files }}
fi
- name: Check env
Expand Down
12 changes: 6 additions & 6 deletions scripts/check_renamed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import coloredlogs, logging
from typing import Dict, List

p = os.path.abspath(os.path.join(__file__, "../../.."))
os.chdir(p)
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + "/../../")

REDIRECTED_FILE = "_redirects"

logger = logging.getLogger("check_renamed_files")
logging.basicConfig(format="%(asctime)s - [%(levelname)s] - %(message)s")
Expand Down Expand Up @@ -42,6 +41,7 @@ def find_redirected() -> Dict:
:returns: set with redirected files
:rtype: set
"""
REDIRECTED_FILE = "_redirects"
all_redirected_links = {}
with open(REDIRECTED_FILE) as f:
lines = f.readlines()
Expand Down Expand Up @@ -109,10 +109,10 @@ def check_missing_redirects(renamed_files: List[str]):
sys.exit()

res = ""
h = ["Previous Name", "Current Name"]
logger.error("{:<40s} {:<40s}".format(*h))
h = ["Previous Name", " Current Name"]
logger.error("{:<45s} {:<45s}".format(*h))
for k, v in missing_redirects.items():
logger.error("/{:<40s} /{:<40s}".format(k, v))
logger.error("/{:<45s} /{:<45s}".format(k, v))

logger.info("🚨 Seems like you forgot to add redirects for the renamed files. 🚨")
logger.info(
Expand Down

0 comments on commit 50e1abb

Please sign in to comment.