Skip to content

Commit

Permalink
Merge pull request #28 from plone/config-with-default-template-43aa1e09
Browse files Browse the repository at this point in the history
Config with default template
  • Loading branch information
gforcada authored Mar 8, 2023
2 parents e5e8275 + b2d3b98 commit 7c984be
Show file tree
Hide file tree
Showing 19 changed files with 275 additions and 90 deletions.
39 changes: 39 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
#
# EditorConfig Configuration file, for more details see:
# http://EditorConfig.org
# EditorConfig is a convention description, that could be interpreted
# by multiple editors to enforce common coding conventions for specific
# file types

# top-most EditorConfig file:
# Will ignore other EditorConfig files in Home directory or upper tree level.
root = true


[*] # For All Files
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Set default charset
charset = utf-8
# Indent style default
indent_style = space
# Max Line Length - a hard line wrap, should be disabled
max_line_length = off

[*.{py,cfg,ini}]
# 4 space indentation
indent_size = 4

[*.{yml,zpt,pt,dtml,zcml}]
# 2 space indentation
indent_size = 2

[{Makefile,.gitmodules}]
# Tab indentation (no size specified, but view as 4 spaces)
indent_style = tab
indent_size = unset
tab_width = unset
13 changes: 13 additions & 0 deletions .meta.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
[meta]
template = "default"
commit-id = "13d8d6c0"

[codespell]
additional-ignores = "ist,discreet"

[dependencies]
mappings = [
"Zope = ['Products.Five', 'Products.PageTemplates', 'ZTUtils']",
]
42 changes: 42 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
ci:
autofix_prs: false
autoupdate_schedule: monthly

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/collective/zpretty
rev: 3.0.2
hooks:
- id: zpretty
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
- repo: https://github.com/regebro/pyroma
rev: "4.2"
hooks:
- id: pyroma
2 changes: 2 additions & 0 deletions news/13d8d6c0.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update configuration files.
[plone devs]
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Generated from:
# https://github.com/plone/meta/tree/master/config/default
[tool.towncrier]
filename = "CHANGES.rst"
directory = "news/"
Expand All @@ -18,3 +20,30 @@ showcontent = true
directory = "bugfix"
name = "Bug fixes:"
showcontent = true

[[tool.towncrier.type]]
directory = "internal"
name = "Internal:"
showcontent = true

[[tool.towncrier.type]]
directory = "documentation"
name = "Documentation:"
showcontent = true

[[tool.towncrier.type]]
directory = "tests"
name = "Tests"
showcontent = true

[tool.isort]
profile = "plone"

[tool.black]
target-version = ["py38"]

[tool.codespell]
ignore-words-list = "ist,discreet"

[tool.dependencychecker]
Zope = ['Products.Five', 'Products.PageTemplates', 'ZTUtils']
42 changes: 31 additions & 11 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,26 @@ python_requires = >=3.8
install_requires =
setuptools
# be aware to _not_ add dependencies to plone.app.* or Plones Products.* packages!
AccessControl
Acquisition
ZODB
Zope>=5
plone.batching
plone.registry
plone.schema
plone.z3cform
Products.BTreeFolder2
Products.CMFCore
Products.CMFDynamicViewFTI
Zope>=5
transaction
zExceptions
zope.component
zope.deprecation
zope.i18n
zope.i18nmessageid
zope.interface
zope.publisher
zope.schema
namespace_packages =
plone

Expand All @@ -47,8 +60,8 @@ zip_safe = False

[options.extras_require]
test =
plone.testing
plone.subrequest
zope.tal

[options.packages.find]
where =
Expand All @@ -65,14 +78,21 @@ ignore =
.coveragerc
.editorconfig
.gitattributes
.meta.toml
.pre-commit-config.yaml
tox.ini

[flake8]
exclude = docs,*.egg.
max-complexity = 15

[isort]
# black compatible Plone isort rules:
profile = black
force_alphabetical_sort = True
force_single_line = True
lines_after_imports = 2
doctests = 1
ignore =
# black takes care of line length
E501,
# black takes care of where to break lines
W503,
# black takes care of spaces within slicing (list[:])
E203,
# black takes care of spaces after commas
E231,
per-file-ignores =
src/plone/base/interfaces/__init__.py:F401
src/plone/base/permissions.py:F401,E402
1 change: 0 additions & 1 deletion src/plone/base/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Batch(QuantumBatch):

b_start_str = "b_start"

def __init__(
Expand Down
6 changes: 3 additions & 3 deletions src/plone/base/i18nl10n.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ def ulocalized_time(
# catalog date_format_long, date_format_short, and time_format
# These msgids are translated using interpolation.
# The variables used here are the same as used in the strftime
# formating.
# formatting.
# Supported are:
# %A, %a, %B, %b, %H, %I, %m, %d, %M, %p, %S, %Y, %y, %Z
# Each used as variable in the msgstr without the %.
# For example: "${A} ${d}. ${B} ${Y}, ${H}:${M} ${Z}"
# Each language dependend part is translated itself as well.
# Each language dependent part is translated itself as well.

# From http://docs.python.org/lib/module-time.html
#
Expand All @@ -206,7 +206,7 @@ def ulocalized_time(
if not IDateTime.providedBy(time):
try:
time = DateTime(time)
except:
except Exception:
logger.debug(f"Failed to convert {time} to a DateTime object")
return None

Expand Down
1 change: 0 additions & 1 deletion src/plone/base/interfaces/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flake8: noqa
from .basetool import IPloneBaseTool
from .basetool import IPloneCatalogTool
from .basetool import IPloneTool
Expand Down
Loading

0 comments on commit 7c984be

Please sign in to comment.