Skip to content

Commit

Permalink
Merge pull request bitdust-io#87 from vesellov/master
Browse files Browse the repository at this point in the history
	new file:   .github/workflows/pull_request.yml
  • Loading branch information
vesellov authored Jun 16, 2024
2 parents 13553c1 + 68bc4c3 commit 27f7ac4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: BitDust p2p-app quality checks

on:
pull_request:
branches: [ "master" ]

jobs:
quality_checks:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: clean venv
run: make clean venv

- name: check_no_debug
run: make check_no_debug
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,14 @@ update:

run:
@$(PYTHON) -u src/main.py

check_no_debug:
@grep --include=\*.py -rnw 'src' -e "_Debug = True" | tee /tmp/no_debug_report.txt
@if [ -s /tmp/no_debug_report.txt ]; then rm -rf /tmp/no_debug_report.txt; echo "CODE CHECK FAILED: at least one time '_Debug = True' is present in the source code"; exit 1; fi
@rm -rf /tmp/no_debug_report.txt;

debug_on:
@find ./src -type f -name "*.py" -exec python3 -c 'import sys; inp=open(sys.argv[1]).read();outp=inp.replace("_Debug = False", "_Debug = True"); open(sys.argv[1],"w").write(outp); print(sys.argv[1], len(outp), "CHANGED" if inp != outp else "");' '{}' \;

debug_off:
@find ./src -type f -name "*.py" -exec python3 -c 'import sys; inp=open(sys.argv[1]).read();outp=inp.replace("_Debug = True", "_Debug = False"); open(sys.argv[1],"w").write(outp); print(sys.argv[1], len(outp), "CHANGED" if inp != outp else "");' '{}' \;

0 comments on commit 27f7ac4

Please sign in to comment.