-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
214 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
name: Linting | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
name: Format and lint code | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.8"] | ||
os: ["ubuntu-22.04"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Cache packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('lint-requirements.txt', 'tox.ini') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-${{ matrix.python-version }}- | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: python -m pip install tox | ||
- name: Run formatters | ||
run: tox -e format | ||
# linters | ||
- name: QA | ||
run: tox -e lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Generated from: | ||
# https://github.com/plone/meta/tree/master/config/default | ||
[meta] | ||
template = "default" | ||
commit-id = "68486a87" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Generated from: | ||
# https://github.com/plone/meta/tree/master/config/default | ||
black==22.12.0 | ||
check-manifest==0.49 | ||
codespell==2.2.2 | ||
flake8==6.0.0 | ||
isort==5.11.4 | ||
pipdeptree==2.3.3 | ||
pyroma==4.1 | ||
pyupgrade==3.3.1 | ||
z3c.dependencychecker==2.10 | ||
zpretty==2.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
[check-manifest] | ||
ignore = | ||
*.cfg | ||
bootstrap.py | ||
|
||
# Generated from: | ||
# https://github.com/plone/meta/tree/master/config/default | ||
[bdist_wheel] | ||
universal = 0 | ||
|
||
[flake8] | ||
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, | ||
|
||
[bdist_wheel] | ||
universal = 1 | ||
[check-manifest] | ||
ignore = | ||
.editorconfig | ||
.meta.toml | ||
tox.ini | ||
lint-requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Generated from: | ||
# https://github.com/plone/meta/tree/master/config/default | ||
[tox] | ||
envlist = | ||
format | ||
lint | ||
|
||
[testenv] | ||
py_files = git ls-files "*.py" | ||
text_files = git ls-files "*.rst" "*.md" | ||
xml_files = git ls-files "*.xml" | ||
zcml_files = git ls-files "*.zcml" | ||
allowlist_externals = | ||
sh | ||
|
||
[testenv:format] | ||
description = automatically reformat python code | ||
skip_install = true | ||
deps = | ||
pyupgrade | ||
isort | ||
black | ||
zpretty | ||
-c lint-requirements.txt | ||
commands = | ||
sh -c '{[testenv]py_files} | xargs pyupgrade --py38-plus' | ||
sh -c '{[testenv]py_files} | xargs isort' | ||
sh -c '{[testenv]py_files} | xargs black' | ||
sh -c '{[testenv]xml_files} | xargs zpretty -x -i || true' | ||
sh -c '{[testenv]zcml_files} | xargs zpretty -z -i || true' | ||
|
||
[testenv:lint] | ||
description = run linters that will help improve the code style | ||
skip_install = true | ||
deps = | ||
flake8 | ||
codespell | ||
tomli # needed for codespell to read pyproject.toml | ||
check-manifest | ||
pyroma | ||
-c lint-requirements.txt | ||
commands = | ||
sh -c '{[testenv]py_files} | xargs flake8' | ||
sh -c '{[testenv]py_files} | xargs codespell' | ||
sh -c '{[testenv]text_files} | xargs codespell' | ||
check-manifest | ||
pyroma -n 10 . | ||
|
||
[testenv:dependencies] | ||
description = check if the package defines all its dependencies | ||
deps = | ||
z3c.dependencychecker | ||
-c lint-requirements.txt | ||
commands = | ||
dependencychecker | ||
|
||
[testenv:dependencies-graph] | ||
description = generate a graph with the distribution dependencies | ||
deps = | ||
pipdeptree | ||
graphviz # optional dependency of pipdeptree | ||
-c lint-requirements.txt | ||
commands = | ||
sh -c 'pipdeptree --exclude setuptools,pipdeptree,wheel --graph-output svg > dependencies.svg' | ||
|
||
[testenv:test] | ||
description = run the distribution's tests | ||
deps = | ||
borg.localrole[test] | ||
pytest | ||
gocept.pytestlayer | ||
-c https://dist.plone.org/release/6.0-dev/constraints.txt | ||
commands = | ||
pip install -e . | ||
pytest |