Skip to content

small changes to CI #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[flake8]
count = True
show_source = True
statistics = True
max_line_length = 127
per_file_ignores =
__init__.py: F401, D104
setup.py: D102, D100, D104
fight_handler.py: E221
tests/*: D102
tests/__init__.py: D104
battle.py: E501, C901
docstring_convention = numpy
ignore = D105, D401, E203, E302
exclude =
.git,
__pycache__,
algobattle/problems/*
ignore_decorators=inherit_docs
12 changes: 3 additions & 9 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Algorithmic Battle

on:
push:
branches: [ main, develop ]
branches: [ main, develop, 4.0.0-rc ]
pull_request:
branches: [ main, develop ]
branches: [ main, develop, 4.0.0-rc ]

jobs:
lint:
Expand All @@ -23,13 +23,7 @@ jobs:
python -m pip install --upgrade pip
pip install flake8 flake8-docstrings
- name: Lint with flake8
run: |
flake8 . --count --max-complexity=10 --max-line-length=127 \
--per-file-ignores="__init__.py:F401,D104 */solver_execution_error/main.py:E999 \
*/generator_execution_error/main.py:E999 fight_handler.py:E221 setup.py:D102,D100 \
*/problems/*/verifier.py:D102 */problems/*/parser.py:D102 tests/__init__.py:D104 \
scripts/battle:E501,C901" \
--docstring-convention numpy --show-source --statistics --ignore=D105,D401,E221
run: flake8 .

test:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions algobattle/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ def format_match_data_as_utf8(self) -> str:
rounds_block = ''.join(['{}\n\r'.format(round_line) for round_line in round_lines])
lower_border = self._format_delimiter_line_utf8(line_char='═', left_delim='╚', mid_delim='╩', right_delim='╝')

return('{}\n\r{}\n\r{}\n\r{}\n\r{}{}\n\r'.format(battle_type,
return '{}\n\r{}\n\r{}\n\r{}\n\r{}{}\n\r'.format(battle_type,
upper_border,
header,
separator,
rounds_block,
lower_border))
lower_border)

def _format_delimiter_line_utf8(self, line_char, left_delim, mid_delim, right_delim) -> str:
"""Helper function to draw delimiter lines, such as borders and seperator lines.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def setUp(self) -> None:
self.fight_handler = FightHandler(self.problem, self.config)
self.problem_path = Path(Problem.__file__).parent
self.rand_file_name = random.randint(0, 2 ** 80)
while(Path(str(self.rand_file_name)).exists()):
while Path(str(self.rand_file_name)).exists():
self.rand_file_name = random.randint(0, 2 ** 80)

def test_import_problem_from_path_existing_path(self):
Expand Down