diff --git a/.github/workflows/format_and_lint_pr.yaml b/.github/workflows/format_and_lint_pr.yaml index e3564e376..f0fe2b183 100644 --- a/.github/workflows/format_and_lint_pr.yaml +++ b/.github/workflows/format_and_lint_pr.yaml @@ -1,4 +1,4 @@ -name: Format and lint code +name: Lint code on: pull_request: permissions: @@ -15,5 +15,11 @@ jobs: python-version: '3.x' - name: Run Black uses: psf/black@stable + with: + options: "--check --diff -S" + - name: Install Flake8 + run: | + python -m pip install --upgrade pip + pip install flake8 - name: Run Flake8 run: flake8 . diff --git a/pelicun/tests/code_repetition_checker.py b/pelicun/tests/code_repetition_checker.py index 3bf66f4f6..d4a02276f 100644 --- a/pelicun/tests/code_repetition_checker.py +++ b/pelicun/tests/code_repetition_checker.py @@ -80,6 +80,70 @@ def all_test_files(): runs the main function to find and print repeated line blocks in each file. """ test_files = glob('tests/*.py') + very_long_line = [ + 1.00, + 2.00, + 3.00, + 4.00, + 5.00, + 6.00, + 1.00, + 2.00, + 3.00, + 4.00, + 5.00, + 6.00, + 1.00, + 2.00, + 3.00, + 4.00, + 5.00, + 6.00, + 1.00, + 2.00, + 3.00, + 4.00, + 5.00, + 6.00, + 1.00, + 2.00, + 3.00, + 4.00, + 5.00, + 6.00, + 1.00, + 2.00, + 3.00, + 4.00, + 5.00, + 6.00, + 1.00, + 2.00, + 3.00, + 4.00, + 5.00, + 6.00, + 1.00, + 2.00, + 3.00, + 4.00, + 5.00, + 6.00, + ] + very_long_string = ( + 'some very long thing which is some very ' + 'long thing which is some very long thing ' + 'which is some very long thing which is ' + 'some very long thing which is some very ' + 'long thing which is some very long thing ' + 'which is some very long thing which is ' + 'some very long thing which is some very ' + 'long thing which is some very long thing ' + 'which is some very long thing which is ' + 'very long indeed.' + ) + assert very_long_line is not None + assert very_long_string is not None for file in test_files: print() print(file)