Skip to content

Commit

Permalink
Merge pull request #507 from iKostanOrg/master
Browse files Browse the repository at this point in the history
Merge from master to kyu2
  • Loading branch information
ikostan authored Oct 30, 2024
2 parents 01d22c2 + 09930f8 commit c3e7883
Show file tree
Hide file tree
Showing 231 changed files with 1,225 additions and 949 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Flake8

on: # yamllint disable-line rule:truthy
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.x"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
# This is the version of the action for setting up Python,
# not the Python version.
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# You can test your matrix by printing the current
# Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install flake8
- name: Check to make sure that the module is in your Python path
run: |
echo $PYTHONPATH
- name: Lint with flake8
# yamllint disable rule:line-length
# stop the build if there are Python syntax errors or undefined names
# exit-zero treats all errors as warnings.
# The GitHub editor is 127 chars wide
run: |
flake8 . --count --select=E9,F63,F7,F82 --doctests --show-source --statistics
flake8 . --count --max-complexity=10 --max-line-length=127 --benchmark --show-source --statistics
# yamllint enable rule:line-length
8 changes: 7 additions & 1 deletion .github/workflows/lint_test_build_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ jobs:
uses: iKostanOrg/codewars/.github/workflows/markdown_lint.yml@master
pyint:
name: PyLint
uses: iKostanOrg/codewars/.github/workflows/pylint.yml@master
uses: iKostanOrg/codewars/.github/workflows/pylint.yml@master
mypy:
name: MyPy Lint
uses: iKostanOrg/codewars/.github/workflows/mypy.yml@master
flake8:
name: MyPy Lint
uses: iKostanOrg/codewars/.github/workflows/flake8.yml@master
66 changes: 66 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: MyPy Lint

on:
push:
branches:
- 'utils'
- 'none'
workflow_call:

permissions:
contents: read
pull-requests: read


jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.x"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
# This is the version of the action for setting up Python,
# not the Python version.
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install mypy
pip install types-requests
- name: Check to make sure that the module is in your Python path
run: |
echo $PYTHONPATH
- name: kyu2 Python Data Type Checking with MyPy
# Python Type Checking (Guide)
# https://realpython.com/python-type-checking/
run: |
mypy kyu_2 --ignore-missing-imports --check-untyped-defs
- name: kyu_3 Python Data Type Checking with MyPy
run: |
mypy kyu_3 --ignore-missing-imports --check-untyped-defs
- name: kyu_4 Python Data Type Checking with MyPy
run: |
mypy kyu_4 --ignore-missing-imports --check-untyped-defs
- name: kyu_5 Python Data Type Checking with MyPy
run: |
mypy kyu_5 --ignore-missing-imports --check-untyped-defs
- name: kyu_6 Python Data Type Checking with MyPy
run: |
mypy kyu_6 --ignore-missing-imports --check-untyped-defs
- name: kyu_7 Python Data Type Checking with MyPy
run: |
mypy kyu_7 --ignore-missing-imports --check-untyped-defs
- name: kyu_8 Python Data Type Checking with MyPy
run: |
mypy kyu_8 --ignore-missing-imports --check-untyped-defs
- name: utils Python Data Type Checking with MyPy
run: |
mypy utils --ignore-missing-imports --check-untyped-defs
38 changes: 38 additions & 0 deletions .github/workflows/mypy_kyu4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: MyPy for kyu4

on:
push:
branches:
- 'kyu4'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.x"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
# This is the version of the action for setting up Python,
# not the Python version.
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install mypy
pip install types-requests
- name: Check to make sure that the module is in your Python path
run: |
echo $PYTHONPATH
- name: Python Data Type Checking with MyPy
# Python Type Checking (Guide)
# https://realpython.com/python-type-checking/
run: |
mypy kyu_4 --ignore-missing-imports --check-untyped-defs
38 changes: 38 additions & 0 deletions .github/workflows/mypy_kyu5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: MyPy for kyu5

on:
push:
branches:
- 'kyu5'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.x"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
# This is the version of the action for setting up Python,
# not the Python version.
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install mypy
pip install types-requests
- name: Check to make sure that the module is in your Python path
run: |
echo $PYTHONPATH
- name: Python Data Type Checking with MyPy
# Python Type Checking (Guide)
# https://realpython.com/python-type-checking/
run: |
mypy kyu_5 --ignore-missing-imports --check-untyped-defs
38 changes: 38 additions & 0 deletions .github/workflows/mypy_kyu6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: MyPy for kyu6

on:
push:
branches:
- 'kyu6'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.x"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
# This is the version of the action for setting up Python,
# not the Python version.
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install mypy
pip install types-requests
- name: Check to make sure that the module is in your Python path
run: |
echo $PYTHONPATH
- name: Python Data Type Checking with MyPy
# Python Type Checking (Guide)
# https://realpython.com/python-type-checking/
run: |
mypy kyu_6 --ignore-missing-imports --check-untyped-defs
38 changes: 38 additions & 0 deletions .github/workflows/mypy_kyu7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: MyPy for kyu7

on:
push:
branches:
- 'kyu7'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.x"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
# This is the version of the action for setting up Python,
# not the Python version.
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install mypy
pip install types-requests
- name: Check to make sure that the module is in your Python path
run: |
echo $PYTHONPATH
- name: Python Data Type Checking with MyPy
# Python Type Checking (Guide)
# https://realpython.com/python-type-checking/
run: |
mypy kyu_7 --ignore-missing-imports --check-untyped-defs
38 changes: 38 additions & 0 deletions .github/workflows/mypy_kyu8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: MyPy for kyu8

on:
push:
branches:
- 'kyu8'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.x"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
# This is the version of the action for setting up Python,
# not the Python version.
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install mypy
pip install types-requests
- name: Check to make sure that the module is in your Python path
run: |
echo $PYTHONPATH
- name: Python Data Type Checking with MyPy
# Python Type Checking (Guide)
# https://realpython.com/python-type-checking/
run: |
mypy kyu_8 --ignore-missing-imports --check-untyped-defs
12 changes: 6 additions & 6 deletions kyu_3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ rank - the harder the kata the faster you advance.

### List of Completed Kata (Python 3)
<!-- markdownlint-disable MD013 -->
| No. | Puzzle/Kata Name | Solution / GitHub Link |
|-----|:--------------------------------------------------------------------------------------------------:|--------------------------------------------------------------------------------------------------------:|
|1 | [Calculator](https://www.codewars.com/kata/5235c913397cbf2508000048) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_3/calculator) |
|2 | [Rail Fence Cipher: Encoding and Decoding](https://www.codewars.com/kata/58c5577d61aefcf3ff000081) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_3/rail_fence_cipher_encoding_and_decoding)|
|3 | [Make a spiral](https://www.codewars.com/kata/534e01fbbb17187c7e0000c6) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_3/make_spiral) |
|4 | [Battleship field validator](https://www.codewars.com/kata/52bb6539a4cf1b12d90005b7) |[Solution](https://github.com/ikostan/codewars/tree/master/kyu_3/battleship_field_validator) |
| No. | Puzzle/Kata Name | Solution / GitHub Link |
|-----|:--------------------------------------------------------------------------------------------------:|----------------------------------------------------------------------------------------------------------:|
| 1 | [Calculator](https://www.codewars.com/kata/5235c913397cbf2508000048) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_3/calculator) |
| 2 | [Rail Fence Cipher: Encoding and Decoding](https://www.codewars.com/kata/58c5577d61aefcf3ff000081) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_3/rail_fence_cipher_encoding_and_decoding) |
| 3 | [Make a spiral](https://www.codewars.com/kata/534e01fbbb17187c7e0000c6) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_3/make_spiral) |
| 4 | [Battleship field validator](https://www.codewars.com/kata/52bb6539a4cf1b12d90005b7) | [Solution](https://github.com/ikostan/codewars/tree/master/kyu_3/battleship_field_validator) |
<!-- markdownlint-enable MD013 -->
[Source](https://www.codewars.com/about)
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def test_decoding(self):
"""
Testing Decoding functionality
"""
# pylint: disable-msg=R0801
allure.dynamic.title("Testing Decoding functionality")
allure.dynamic.severity(allure.severity_level.NORMAL)
allure.dynamic.description_html(
Expand All @@ -48,14 +49,13 @@ def test_decoding(self):
'<h3>Test Description:</h3>'
"<p>Verify cipher function. This \"decode\" is used "
"to decode a string.</p>")

# pylint: enable-msg=R0801
test_data: tuple = (
("H !e,Wdloollr", 4, "Hello, World!"),
("WECRLTEERDSOEEFEAOCAIVDEN", 3, "WEAREDISCOVEREDFLEEATONCE"),
("", 3, ""),
("WEAREDISCOVEREDFLEEATONCE", 10, "WADCEDETNECOEFROIREESVELA"),
("WEAREDISCOVEREDFLEEATONCE", 9, "WADCEDETCOEFROIREESVELANE")
)
("WEAREDISCOVEREDFLEEATONCE", 9, "WADCEDETCOEFROIREESVELANE"))
# pylint: disable-msg=R0801
for string, n, expected in test_data:

Expand Down
Loading

0 comments on commit c3e7883

Please sign in to comment.