forked from mirrors/bookwyrm
Merge pull request #2150 from cincodenada/fix-pylint
Fix pylint config for pylint 2.14.0
This commit is contained in:
commit
08231f52ff
8 changed files with 19 additions and 7 deletions
3
.github/workflows/pylint.yml
vendored
3
.github/workflows/pylint.yml
vendored
|
@ -21,8 +21,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pylint
|
|
||||||
- name: Analysing the code with pylint
|
- name: Analysing the code with pylint
|
||||||
run: |
|
run: |
|
||||||
pylint bookwyrm/ --ignore=migrations --disable=E1101,E1135,E1136,R0903,R0901,R0902,W0707,W0511,W0406,R0401,R0801
|
pylint bookwyrm/
|
||||||
|
|
||||||
|
|
6
.pylintrc
Normal file
6
.pylintrc
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[MAIN]
|
||||||
|
ignore=migrations
|
||||||
|
load-plugins=pylint.extensions.no_self_use
|
||||||
|
|
||||||
|
[MESSAGES CONTROL]
|
||||||
|
disable=E1101,E1135,E1136,R0903,R0901,R0902,W0707,W0511,W0406,R0401,R0801,C3001
|
|
@ -6,6 +6,7 @@ RUN mkdir /app /app/static /app/images
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y gettext libgettextpo-dev tidy && apt-get clean
|
||||||
|
|
||||||
COPY requirements.txt /app/
|
COPY requirements.txt /app/
|
||||||
RUN pip install -r requirements.txt --no-cache-dir
|
RUN pip install -r requirements.txt --no-cache-dir
|
||||||
RUN apt-get update && apt-get install -y gettext libgettextpo-dev tidy && apt-get clean
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ class Openlibrary(TestCase):
|
||||||
status=200,
|
status=200,
|
||||||
)
|
)
|
||||||
with patch(
|
with patch(
|
||||||
"bookwyrm.connectors.openlibrary.Connector." "get_authors_from_data"
|
"bookwyrm.connectors.openlibrary.Connector.get_authors_from_data"
|
||||||
) as mock:
|
) as mock:
|
||||||
mock.return_value = []
|
mock.return_value = []
|
||||||
result = self.connector.create_edition_from_data(work, self.edition_data)
|
result = self.connector.create_edition_from_data(work, self.edition_data)
|
||||||
|
|
|
@ -195,7 +195,7 @@ class ImportJob(TestCase):
|
||||||
) as search:
|
) as search:
|
||||||
search.return_value = result
|
search.return_value = result
|
||||||
with patch(
|
with patch(
|
||||||
"bookwyrm.connectors.openlibrary.Connector." "get_authors_from_data"
|
"bookwyrm.connectors.openlibrary.Connector.get_authors_from_data"
|
||||||
):
|
):
|
||||||
book = item.get_book_from_identifier()
|
book = item.get_book_from_identifier()
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ http://www.fish.com/"""
|
||||||
result = views.status.to_markdown(text)
|
result = views.status.to_markdown(text)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
result,
|
result,
|
||||||
'<p><em>hi</em> and <a href="http://fish.com">fish.com</a> ' "is rad</p>",
|
'<p><em>hi</em> and <a href="http://fish.com">fish.com</a> is rad</p>',
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_to_markdown_detect_url(self, *_):
|
def test_to_markdown_detect_url(self, *_):
|
||||||
|
@ -297,7 +297,7 @@ http://www.fish.com/"""
|
||||||
"""this is mostly handled in other places, but nonetheless"""
|
"""this is mostly handled in other places, but nonetheless"""
|
||||||
text = "[hi](http://fish.com) is <marquee>rad</marquee>"
|
text = "[hi](http://fish.com) is <marquee>rad</marquee>"
|
||||||
result = views.status.to_markdown(text)
|
result = views.status.to_markdown(text)
|
||||||
self.assertEqual(result, '<p><a href="http://fish.com">hi</a> ' "is rad</p>")
|
self.assertEqual(result, '<p><a href="http://fish.com">hi</a> is rad</p>')
|
||||||
|
|
||||||
def test_delete_status(self, mock, *_):
|
def test_delete_status(self, mock, *_):
|
||||||
"""marks a status as deleted"""
|
"""marks a status as deleted"""
|
||||||
|
|
5
bw-dev
5
bw-dev
|
@ -140,6 +140,10 @@ case "$CMD" in
|
||||||
black)
|
black)
|
||||||
docker-compose run --rm dev-tools black celerywyrm bookwyrm
|
docker-compose run --rm dev-tools black celerywyrm bookwyrm
|
||||||
;;
|
;;
|
||||||
|
pylint)
|
||||||
|
# pylint depends on having the app dependencies in place, so we run it in the web container
|
||||||
|
runweb pylint bookwyrm/
|
||||||
|
;;
|
||||||
prettier)
|
prettier)
|
||||||
docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js
|
docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js
|
||||||
;;
|
;;
|
||||||
|
@ -149,6 +153,7 @@ case "$CMD" in
|
||||||
--config dev-tools/.stylelintrc.js
|
--config dev-tools/.stylelintrc.js
|
||||||
;;
|
;;
|
||||||
formatters)
|
formatters)
|
||||||
|
runweb pylint bookwyrm/
|
||||||
docker-compose run --rm dev-tools black celerywyrm bookwyrm
|
docker-compose run --rm dev-tools black celerywyrm bookwyrm
|
||||||
docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js
|
docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js
|
||||||
docker-compose run --rm dev-tools npx stylelint \
|
docker-compose run --rm dev-tools npx stylelint \
|
||||||
|
|
|
@ -35,3 +35,4 @@ pytest-cov==2.10.1
|
||||||
pytest-env==0.6.2
|
pytest-env==0.6.2
|
||||||
pytest-xdist==2.3.0
|
pytest-xdist==2.3.0
|
||||||
pytidylib==0.3.2
|
pytidylib==0.3.2
|
||||||
|
pylint==2.14.0
|
||||||
|
|
Loading…
Reference in a new issue