From 476d6d8bd915b48671333286f1287f0b74dca96b Mon Sep 17 00:00:00 2001 From: Abhishek Date: Fri, 12 Apr 2024 02:58:51 +0530 Subject: [PATCH 1/3] reverse_string --- practice/reverse-string/reverse_string.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/practice/reverse-string/reverse_string.py b/practice/reverse-string/reverse_string.py index 4690cc7..731a1d7 100644 --- a/practice/reverse-string/reverse_string.py +++ b/practice/reverse-string/reverse_string.py @@ -1,2 +1,11 @@ -def reverse(text): - pass +def reverse(text): + reversed_text = "" + for i in range(len(text)-1, -1, -1): + reversed_text += text[i] + return reversed_text +pass + + # My approach -----> + # initialising empty string to hold reversed text + # iterating through string in reverse order + # appending each char from end to beginning \ No newline at end of file From 51dec901a9e74296f38ddf8a4279fa54ba36f100 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Mon, 22 Apr 2024 02:25:59 +0530 Subject: [PATCH 2/3] run impacted tests only --- .github/workflows/python-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 48d1bde..a4e04c8 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -30,7 +30,8 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with pytest run: | - pytest --continue-on-collection-errors + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + git diff origin/main HEAD --name-only -- practice | xargs dirname | sort | uniq | xargs pytest - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names From ceb43e43f3d41bcaa3f02c61e353e2ceb7170a21 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Mon, 22 Apr 2024 02:36:36 +0530 Subject: [PATCH 3/3] resolved conflicts --- .github/workflows/python-app.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index a4e04c8..e1ba390 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -30,11 +30,11 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with pytest run: | - git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - git diff origin/main HEAD --name-only -- practice | xargs dirname | sort | uniq | xargs pytest + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + git diff origin/main HEAD --name-only -- practice | xargs dirname | sort | uniq | xargs pytest - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics \ No newline at end of file