simonwillisonblog icon indicating copy to clipboard operation
simonwillisonblog copied to clipboard

WIP: Run prettier against all the templates

Open simonw opened this issue 1 year ago • 2 comments

https://til.simonwillison.net/npm/prettier-django

simonw avatar Jun 20 '24 03:06 simonw

It broke at least the year archive page:

CleanShot 2024-06-19 at 20 07 48@2x

simonw avatar Jun 20 '24 03:06 simonw

Test failure in Circle CI: https://app.circleci.com/pipelines/github/simonw/simonwillisonblog/951/workflows/01ce1081-96c4-4f0e-8cfc-09360a929d91/jobs/962

System check identified no issues (2 silenced).
......F...
======================================================================
FAIL: test_markup (blog.tests.BlogTests.test_markup)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/testcases.py", line 78, in assert_and_parse_html
    dom = parse_html(html)
          ^^^^^^^^^^^^^^^^
  File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/html.py", line 266, in parse_html
    parser.feed(html)
  File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/html/parser.py", line 110, in feed
    self.goahead(0)
  File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/html/parser.py", line 172, in goahead
    k = self.parse_endtag(i)
        ^^^^^^^^^^^^^^^^^^^^
  File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/html/parser.py", line 413, in parse_endtag
    self.handle_endtag(elem)
  File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/html.py", line 249, in handle_endtag
    self.error(
  File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/html.py", line 212, in error
    raise HTMLParseError(msg, self.getpos())
django.test.html.HTMLParseError: ('Unexpected end tag `body` (Line 130, Column 0)', (130, 0))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/circleci/project/blog/tests.py", line 72, in test_markup
    self.assertContains(
  File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/testcases.py", line 524, in assertContains
    text_repr, real_count, msg_prefix = self._assert_contains(
                                        ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/testcases.py", line 505, in _assert_contains
    content = assert_and_parse_html(
              ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/circleci/.pyenv/versions/3.11.2/lib/python3.11/site-packages/django/test/testcases.py", line 81, in assert_and_parse_html
    self.fail(self._formatMessage(user_msg, standardMsg))
AssertionError: Response's content is not valid HTML:
('Unexpected end tag `body` (Line 130, Column 0)', (130, 0))

----------------------------------------------------------------------
Ran 10 tests in 1.481s

FAILED (failures=1)
Destroying test database for alias 'default'...

simonw avatar Jun 20 '24 03:06 simonw