Skip to content

Commit

Permalink
Merge pull request #677 from LeXofLeviafan/lint-fix
Browse files Browse the repository at this point in the history
fixed linter warnings & moved linting to a separate CI job
  • Loading branch information
jarun authored Feb 14, 2023
2 parents f00348e + b337e1a commit 7e02931
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
25 changes: 22 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,40 @@ test-template: &test-template
environment:
CI_FORCE_TEST: 1
steps:
- run:
- run: &init
command: |
apt update && apt install -y --no-install-recommends git
pip install --upgrade pip
pip install --upgrade setuptools flake8 pylint
- checkout
- run:
- run: &deps
command: |
pip install -e .[tests]
pip install -r requirements.txt
- run:
command:
python3 -m pytest ./tests/test_*.py --cov buku -vv --durations=0 -c ./tests/pytest.ini

lint-template: &lint-template
working_directory: ~/Buku
environment:
CI_FORCE_TEST: 1
steps:
- run: *init
- checkout
- run: *deps
- run:
command: |
python3 -m flake8
echo buku | xargs pylint --rcfile tests/.pylintrc
find . -iname "*.py" ! -path "./api/*" | xargs pylint --rcfile tests/.pylintrc
python3 -m pytest ./tests/test_*.py --cov buku -vv --durations=0 -c ./tests/pytest.ini
jobs:
lint:
docker:
- image: python:3.7-slim
<<: *lint-template

py37:
docker:
- image: python:3.7-slim
Expand Down Expand Up @@ -102,6 +120,7 @@ workflows:

test:
jobs: &all-tests
- lint
- py37
- py38
- py39
Expand Down
15 changes: 5 additions & 10 deletions bukuserver/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ def create_model(self, form):
)
LOG.exception(msg)
return False
else:
self.after_model_change(form, model, True)
self.after_model_change(form, model, True)
return model

def delete_model(self, model):
Expand All @@ -232,8 +231,7 @@ def delete_model(self, model):
)
LOG.exception(msg)
return False
else:
self.after_model_delete(model)
self.after_model_delete(model)
return res

def get_list(self, page, sort_field, sort_desc, _, filters, page_size=None):
Expand Down Expand Up @@ -409,8 +407,7 @@ def update_model(self, form: forms.BookmarkForm, model: Namespace):
)
LOG.exception(msg)
return False
else:
self.after_model_change(form, model, False)
self.after_model_change(form, model, False)
return res


Expand Down Expand Up @@ -560,8 +557,7 @@ def delete_model(self, model):
)
LOG.exception(msg)
return False
else:
self.after_model_delete(model)
self.after_model_delete(model)
return res

def update_model(self, form, model):
Expand All @@ -581,8 +577,7 @@ def update_model(self, form, model):
)
LOG.exception(msg)
return False
else:
self.after_model_change(form, model, False)
self.after_model_change(form, model, False)
return res

def create_model(self, form):
Expand Down

0 comments on commit 7e02931

Please sign in to comment.