mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 13:01:08 +00:00
Merge branch 'main' into quotes
This commit is contained in:
commit
8d082bc189
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: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install pylint
|
||||
- name: Analysing the code with pylint
|
||||
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
|
||||
|
||||
RUN apt-get update && apt-get install -y gettext libgettextpo-dev tidy && apt-get clean
|
||||
|
||||
COPY requirements.txt /app/
|
||||
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,
|
||||
)
|
||||
with patch(
|
||||
"bookwyrm.connectors.openlibrary.Connector." "get_authors_from_data"
|
||||
"bookwyrm.connectors.openlibrary.Connector.get_authors_from_data"
|
||||
) as mock:
|
||||
mock.return_value = []
|
||||
result = self.connector.create_edition_from_data(work, self.edition_data)
|
||||
|
|
|
@ -195,7 +195,7 @@ class ImportJob(TestCase):
|
|||
) as search:
|
||||
search.return_value = result
|
||||
with patch(
|
||||
"bookwyrm.connectors.openlibrary.Connector." "get_authors_from_data"
|
||||
"bookwyrm.connectors.openlibrary.Connector.get_authors_from_data"
|
||||
):
|
||||
book = item.get_book_from_identifier()
|
||||
|
||||
|
|
|
@ -281,7 +281,7 @@ http://www.fish.com/"""
|
|||
result = views.status.to_markdown(text)
|
||||
self.assertEqual(
|
||||
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, *_):
|
||||
|
@ -297,7 +297,7 @@ http://www.fish.com/"""
|
|||
"""this is mostly handled in other places, but nonetheless"""
|
||||
text = "[hi](http://fish.com) is <marquee>rad</marquee>"
|
||||
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, *_):
|
||||
"""marks a status as deleted"""
|
||||
|
|
5
bw-dev
5
bw-dev
|
@ -140,6 +140,10 @@ case "$CMD" in
|
|||
black)
|
||||
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)
|
||||
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
|
||||
;;
|
||||
formatters)
|
||||
runweb pylint 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 stylelint \
|
||||
|
|
|
@ -35,3 +35,4 @@ pytest-cov==2.10.1
|
|||
pytest-env==0.6.2
|
||||
pytest-xdist==2.3.0
|
||||
pytidylib==0.3.2
|
||||
pylint==2.14.0
|
||||
|
|
Loading…
Reference in a new issue