From 8c015d3c727a088cf1f36b1723bacaff1e3183dd Mon Sep 17 00:00:00 2001 From: Srijan Saurav Date: Tue, 7 Nov 2023 18:11:45 +0530 Subject: [PATCH 1/2] comment out reporting --- .github/workflows/CI.yml | 10 +++++----- assignment.py | 13 ++++++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c71720bf9..e1439dae5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,8 +30,8 @@ jobs: pip install pytest-cov django pytest --cov=./ --cov-report=xml - - name: Report test coverage to DeepSource - run: | - curl https://deepsource.io/cli | sh - ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml - ./bin/deepsource report --analyzer test-coverage --key javascript --value-file ./coverage.xml + # - name: Report test coverage to DeepSource + # run: | + # curl https://deepsource.io/cli | sh + # ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml + # ./bin/deepsource report --analyzer test-coverage --key javascript --value-file ./coverage.xml diff --git a/assignment.py b/assignment.py index 342485235..b95522f1b 100644 --- a/assignment.py +++ b/assignment.py @@ -1,3 +1,5 @@ +import hashlib + FIRST = [1, 2, 3] SECOND = [1, 2, 3] p = [1, 2, 3] @@ -22,10 +24,19 @@ def tested_foo(): return 5 -def untested_foo(): +def print_new_lines(): print("New line 4") print("New line 5") print("New line 6") print("New line 8") print("New line 9") print("New line 10") + +def compute_file_hashes(files=[], hash_algorithm=hashlib.md5) -> dict: + hashes = dict() + for file in files: + f = open(file) + hashed = hash_algorithm(f.read()) + hashes[file] = hashed + + return hashes From 0f10ad37a55b3bbc4b141c82893d53853a6683c4 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 12:42:39 +0000 Subject: [PATCH 2/2] style: format code with Black, isort and Yapf This commit fixes the style issues introduced in 8c015d3 according to the output from Black, isort and Yapf. Details: https://github.com/srijan-deepsource/demo-python/pull/48 --- assignment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/assignment.py b/assignment.py index b95522f1b..56ebd1b1a 100644 --- a/assignment.py +++ b/assignment.py @@ -32,6 +32,7 @@ def print_new_lines(): print("New line 9") print("New line 10") + def compute_file_hashes(files=[], hash_algorithm=hashlib.md5) -> dict: hashes = dict() for file in files: