Skip to content

Commit 1b00c6f

Browse files
committed
formatn and lint
1 parent 0d7fa92 commit 1b00c6f

6 files changed

Lines changed: 29 additions & 32 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This document contains the guidelines, commands, and code style rules for AI cod
66

77
This project uses `make` as the primary task runner, backed by `uv` for Python environment management and `hatchling` as the build system.
88

9+
**IMPORTANT MANDATE**: After you modify *any* Python, XML, ZCML, or PT file, you MUST run `make check` (or `make format && make lint`) and fix any resulting errors before completing your task.
10+
911
### Installation and Running
1012
- **Install the project**:
1113
```bash

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ create-site: $(VENV_FOLDER) instance/etc/zope.ini ## Create a new site from scra
100100
lint: ## Check and fix code base according to Plone standards
101101
@echo "$(GREEN)==> Lint codebase$(RESET)"
102102
@uvx ruff@latest check --fix --config $(BACKEND_FOLDER)/pyproject.toml
103-
@uvx pyroma@latest -d .
103+
@uvx --with hatchling --with pip pyroma@latest -d .
104104
@uvx check-python-versions@latest .
105105
@uvx zpretty@latest --check src
106106

docs/docs/conf.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
# -- Path setup --------------------------------------------------------------
66

77
from datetime import datetime
8-
98
from packaging.version import Version
109
from plone_sphinx_theme import __version__
1110

11+
1212
# If extensions (or modules to document with autodoc) are in another directory,
1313
# add these directories to sys.path here. If the directory is relative to the
1414
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -24,7 +24,7 @@
2424
trademark_name = "codesyntax"
2525
now = datetime.now()
2626
year = str(now.year)
27-
copyright = year
27+
copyright = year # noqa: A001
2828

2929

3030
# The version info for the project you're documenting, acts as replacement for
@@ -101,8 +101,8 @@
101101
r"https://github.com/.*#.*",
102102
# Ignore other specific anchors
103103
]
104-
linkcheck_allowed_redirects = { # TODO: Confirm usage of linkcheck_allowed_redirects
105-
# All HTTP redirections from the source URI to the canonical URI will be treated as "working".
104+
linkcheck_allowed_redirects = {
105+
# All HTTP redirections from the source URI to the canonical URI will be treated as "working". # noqa: E501
106106
}
107107
linkcheck_anchors = True
108108
linkcheck_timeout = 5
@@ -132,7 +132,7 @@
132132
html_theme = "plone_sphinx_theme" # This can be configured
133133
html_logo = "_static/logo.svg"
134134
html_favicon = "_static/favicon.svg"
135-
# The default value includes icon-links, so override it with that one omitted, and add it to html_theme_options[footer_content_items].
135+
# The default value includes icon-links, so override it with that one omitted, and add it to html_theme_options[footer_content_items]. # noqa: E501
136136
html_sidebars = {
137137
"**": [
138138
"navbar-logo",
@@ -142,8 +142,8 @@
142142
}
143143
html_theme_options = {
144144
"article_header_start": ["toggle-primary-sidebar"],
145-
# "extra_footer": """<p>Example `extra_footer` content. License info. Trademark info and usage.</p>
146-
# <p>Pull request previews by <a href="https://readthedocs.org/">Read the Docs</a>.</p>""",
145+
# "extra_footer": """<p>Example `extra_footer` content. License info. Trademark info and usage.</p> # noqa: E501
146+
# <p>Pull request previews by <a href="https://readthedocs.org/">Read the Docs</a>.</p>""", # noqa: E501
147147
"footer_content_items": [
148148
"author",
149149
"copyright",
@@ -248,12 +248,12 @@
248248
myst_enable_extensions = [
249249
"attrs_block", # Support parsing of block attributes.
250250
"attrs_inline", # Support parsing of inline attributes.
251-
"colon_fence", # You can also use ::: delimiters to denote code fences, instead of ```.
252-
"deflist", # Support definition lists. https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#definition-lists
253-
"html_image", # For inline images. See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images
251+
"colon_fence", # You can also use ::: delimiters to denote code fences, instead of ```. # noqa: E501
252+
"deflist", # Support definition lists. https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#definition-lists # noqa: E501
253+
"html_image", # For inline images. See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images # noqa: E501
254254
"linkify", # Identify "bare" web URLs and add hyperlinks.
255-
"strikethrough", # See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-strikethrough
256-
"substitution", # Use Jinja2 for substitutions. https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2
255+
"strikethrough", # See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-strikethrough # noqa: E501
256+
"substitution", # Use Jinja2 for substitutions. https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2 # noqa: E501
257257
]
258258

259259
myst_substitutions = {}

src/cs_dynamicpages/tests/how_tos/test_configure_registry.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import unittest
1+
from cs_dynamicpages.testing import CS_DYNAMICPAGES_INTEGRATION_TESTING
22
from plone.app.testing import setRoles
33
from plone.app.testing import TEST_USER_ID
44

5-
from cs_dynamicpages.testing import CS_DYNAMICPAGES_INTEGRATION_TESTING
5+
import unittest
66

77

88
class TestHowToConfigureRegistry(unittest.TestCase):
@@ -33,8 +33,8 @@ def test_configure_row_widths(self):
3333
self.assertEqual(updated_widths[-1]["row_width_class"], "col-md-4 offset-md-4")
3434

3535
# Test vocabulary behavior
36-
from zope.schema.interfaces import IVocabularyFactory
3736
from zope.component import getUtility
37+
from zope.schema.interfaces import IVocabularyFactory
3838

3939
vocab_factory = getUtility(IVocabularyFactory, name="cs_dynamicpages.RowWidth")
4040
vocab = vocab_factory(self.portal)
@@ -63,8 +63,8 @@ def test_configure_spacers(self):
6363
self.assertEqual(updated_spacers[-1]["spacer_class"], "pt-12")
6464

6565
# Test vocabulary behavior
66-
from zope.schema.interfaces import IVocabularyFactory
6766
from zope.component import getUtility
67+
from zope.schema.interfaces import IVocabularyFactory
6868

6969
vocab_factory = getUtility(
7070
IVocabularyFactory, name="cs_dynamicpages.RowPaddingTop"

src/cs_dynamicpages/tests/how_tos/test_custom_row_view.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
import unittest
2-
from zope.component import getUtility
3-
from plone.registry.interfaces import IRegistry
1+
from cs_dynamicpages.testing import CS_DYNAMICPAGES_INTEGRATION_TESTING
42
from plone.app.testing import setRoles
53
from plone.app.testing import TEST_USER_ID
4+
from zope.component import getUtility
65

7-
from cs_dynamicpages.testing import CS_DYNAMICPAGES_INTEGRATION_TESTING
8-
from cs_dynamicpages.controlpanels.dynamic_pages_control_panel.controlpanel import (
9-
IDynamicPagesControlPanel,
10-
)
6+
import unittest
117

128

139
class TestHowToCustomRowView(unittest.TestCase):
@@ -46,12 +42,12 @@ def test_add_custom_row_view_to_registry(self):
4642
],
4743
}
4844

49-
# To make schema validation pass during test, we need to register a dummy view adapter
50-
# so the vocabulary finds it when checking the 'row_type' value constraints
45+
# To make schema validation pass during test, we need to register a dummy view
46+
# adapter so the vocabulary finds it when checking 'row_type' value constraints
47+
from cs_dynamicpages.content.dynamic_page_row import IDynamicPageRow
5148
from zope.component import getSiteManager
5249
from zope.interface import Interface
5350
from zope.publisher.interfaces.browser import IBrowserRequest
54-
from cs_dynamicpages.content.dynamic_page_row import IDynamicPageRow
5551

5652
class DummyView:
5753
pass
@@ -80,7 +76,6 @@ class DummyView:
8076

8177
# Test vocabulary behavior
8278
from zope.schema.interfaces import IVocabularyFactory
83-
from zope.component import getUtility
8479

8580
vocab_factory = getUtility(IVocabularyFactory, name="cs_dynamicpages.RowType")
8681
vocab = vocab_factory(self.portal)

src/cs_dynamicpages/tests/how_tos/test_using_query_columns.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import unittest
1+
from cs_dynamicpages.testing import CS_DYNAMICPAGES_INTEGRATION_TESTING
22
from plone import api
33
from plone.app.testing import setRoles
44
from plone.app.testing import TEST_USER_ID
55
from zope.component import getMultiAdapter
66

7-
from cs_dynamicpages.testing import CS_DYNAMICPAGES_INTEGRATION_TESTING
7+
import unittest
88

99

1010
class TestHowToUsingQueryColumns(unittest.TestCase):
@@ -100,5 +100,5 @@ def test_configure_query_columns(self):
100100

101101
# It should also contain the layout class (e.g. Bootstrap grid col-*)
102102
# based on columns="3". Let's check if the generic class mapping handles it.
103-
# It could be 'col-md-4' or 'row-cols-md-3' depending on the exact implementation.
104-
# But for the how-to, we just verify it exists and renders.
103+
# It could be 'col-md-4' or 'row-cols-md-3' depending on the exact
104+
# implementation. But for the how-to, we just verify it exists and renders.

0 commit comments

Comments
 (0)