Skip to content

Commit

Permalink
Lint with plone/code-quality
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleybl committed Apr 28, 2023
1 parent 2568903 commit a96bf18
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 14 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Code Analysis
on:
push:

jobs:
black:
name: Black
runs-on: ubuntu-latest

steps:
- name: Checkout codebase
uses: actions/checkout@v3

- name: Run check
uses: plone/code-analysis-action@v2
with:
check: 'black'

flake8:
name: flake8
runs-on: ubuntu-latest

steps:
- name: Checkout codebase
uses: actions/checkout@v2

- name: Run check
uses: plone/code-analysis-action@v2
with:
check: 'flake8'

isort:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v2

- name: Run check
uses: plone/code-analysis-action@v2
with:
check: 'isort'

pyroma:
name: pyroma
runs-on: ubuntu-latest

steps:
- name: Checkout codebase
uses: actions/checkout@v2

- name: Run check
uses: plone/code-analysis-action@v2
with:
check: 'pyroma'

zpretty:
name: zpretty
runs-on: ubuntu-latest

steps:
- name: Checkout codebase
uses: actions/checkout@v2

- name: Run check
uses: plone/code-analysis-action@v2
with:
check: 'zpretty'
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[tool.black]
target-version = ['py38']
include = '\.pyi?$'

[tool.isort]
profile = "black"
force_alphabetical_sort = true
force_single_line = true
lines_after_imports = 2
line_length = 88

[tool.flakeheaven.plugins]
# Disable some checks.
# - E501 line too long
# flake8 is already testing this, with max-line-length=100000 in .flake8,
# so pycodestyle should not test it.
# - W503 line break before binary operator
# Outdated recommendation, see https://www.flake8rules.com/rules/W503.html
mccabe = ["+*"]
pycodestyle = ["+*", "-E501", "-W503"]
pyflakes = ["+*"]
pylint = ["+*"]

[tool.plone-code-analysis]
checkers = ["black", "flake8", "isort", "pyroma", "zpretty"]
formatters = ["black", "isort", "zpretty"]
paths = "setup.py src/"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setup(
name="collective.blueprint.usersandgroups",
version='0.3.2.dev0',
version="0.3.2.dev0",
description="transmogrifier blueprints for importing users and groups into plone",
long_description=long_description,
# Get more from https://pypi.org/classifiers/
Expand Down
27 changes: 14 additions & 13 deletions src/collective/blueprint/usersandgroups/configure.zcml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
<configure
xmlns="http://namespaces.zope.org/zope"
i18n_domain="collective.blueprint.usersandgroups">
i18n_domain="collective.blueprint.usersandgroups"
>

<utility
component=".blueprint.CreateUser"
name="collective.blueprint.usersandgroups.createuser"
/>
name="collective.blueprint.usersandgroups.createuser"
component=".blueprint.CreateUser"
/>

<utility
component=".blueprint.UpdateUserProperties"
name="collective.blueprint.usersandgroups.updateuserproperty"
/>
name="collective.blueprint.usersandgroups.updateuserproperty"
component=".blueprint.UpdateUserProperties"
/>

<utility
component=".blueprint.CreateGroup"
name="collective.blueprint.usersandgroups.creategroup"
/>
name="collective.blueprint.usersandgroups.creategroup"
component=".blueprint.CreateGroup"
/>

<utility
component=".blueprint.UpdateGroupProperties"
name="collective.blueprint.usersandgroups.updategroupproperty"
/>
name="collective.blueprint.usersandgroups.updategroupproperty"
component=".blueprint.UpdateGroupProperties"
/>

</configure>

0 comments on commit a96bf18

Please sign in to comment.