Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove flake8 #283

Merged
merged 4 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .config/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ enrich==1.2.7
exceptiongroup==1.2.1
execnet==2.1.1
filelock==3.15.4
flake8==7.1.0
ghp-import==2.1.0
griffe==0.47.0
gunicorn==22.0.0
Expand Down Expand Up @@ -115,10 +114,8 @@ platformdirs==4.2.2
pluggy==1.5.0
pre-commit==3.7.1
ptyprocess==0.7.0
pycodestyle==2.12.0
pycparser==2.22
pydoclint==0.5.1
pyflakes==3.2.0
pygments==2.18.0
pylint==3.2.4
pymdown-extensions==10.8.1
Expand Down
Empty file.
2 changes: 0 additions & 2 deletions .config/requirements-lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ python-gnupg==0.5.2
pyyaml==6.0.1
referencing==0.31.1
requests==2.32.3
requirements-parser==0.9.0
resolvelib==1.0.1
rfc3339-validator==0.1.4
rich==13.7.1
Expand All @@ -90,7 +89,6 @@ subprocess-tee==0.4.2
tomli==2.0.1
tox==4.15.1
tox-ansible==24.6.18
types-setuptools==70.1.0.20240625
typing-extensions==4.12.2
tzdata==2024.1
urllib3==2.2.2
Expand Down
3 changes: 1 addition & 2 deletions .config/requirements-test.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
ansible-dev-tools[server]
black
coverage[toml]
flake8
mypy
pip-tools
pre-commit
pydoclint[flake8]
pydoclint
pylint
pytest
pytest-xdist
Expand Down
11 changes: 0 additions & 11 deletions .flake8

This file was deleted.

26 changes: 15 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ repos:
rev: v1.5.5
hooks:
- id: remove-tabs
exclude: >
(?x)^(
.config/pydoclint-baseline.txt
)$

- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.3.0
rev: v3.3.2
hooks:
- id: prettier
always_run: true
Expand All @@ -55,28 +59,28 @@ repos:
- id: tox-ini-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.4.10
hooks:
- id: ruff
args:
- --exit-non-zero-on-fix

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.8.2
rev: v8.9.0
hooks:
- id: cspell
name: Spell check with cspell

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
- repo: https://github.com/jsh9/pydoclint
rev: 0.5.1
hooks:
- id: flake8
name: flake8(pydoclint)
additional_dependencies:
- pydoclint[flake8]
- id: pydoclint
# This allows automatic reduction of the baseline file when needed.
entry: sh -ec "pydoclint . && pydoclint --generate-baseline=1 ."
pass_filenames: false

- repo: https://github.com/pycqa/pylint.git
rev: v3.2.2
rev: v3.2.4
hooks:
- id: pylint
args:
Expand All @@ -90,7 +94,7 @@ repos:
- pyyaml

- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.10.0
rev: v1.10.1
hooks:
- id: mypy
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"recommendations": [
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"gruntfuggly.triggertaskonsave",
"markis.code-coverage",
"ms-python.black-formatter",
"ms-python.debugpy",
"ms-python.flake8",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.python",
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
"pylint.importStrategy": "fromEnvironment",
"python.testing.pytestArgs": ["tests"],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false
"python.testing.unittestEnabled": false,
"triggerTaskOnSave.tasks": {
"pydoclint": ["*.py"]
}
}
31 changes: 31 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "pydoclint",
"type": "shell",
"command": "pydoclint",
"args": ["."],
"presentation": {
"reveal": "never"
},
"problemMatcher": {
"owner": "pydoclint",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": {
"regexp": "^(.*?):(\\d+):\\s(.*?):\\s(.*)$",
"file": 1,
"line": 2,
"code": 3,
"message": 4
}
},
"group": {
"kind": "none",
"isDefault": true
}
}
]
}
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ strict = true
ignore_missing_imports = true
module = ["gunicorn.*", "openapi_core.*"]

[tool.pydoclint]
allow-init-docstring = true
arg-type-hints-in-docstring = false
baseline = ".config/pydoclint-baseline.txt"
check-return-types = false
exclude = '\.git|\.tox|build|out|venv'
show-filenames-in-every-violation-message = true
skip-checking-short-docstrings = false
style = "google"

[tool.pylint]

[tool.pylint.format]
Expand Down
29 changes: 28 additions & 1 deletion src/ansible_dev_tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,34 @@


class Colors:
"""ANSI color codes."""
"""ANSI color codes.

Attributes:
BLACK: Black color.
RED: Red color.
GREEN: Green color.
BROWN: Brown color.
BLUE: Blue color.
PURPLE: Purple color.
CYAN: Cyan color.
LIGHT_GRAY: Light gray color.
DARK_GRAY: Dark gray color.
LIGHT_RED: Light red color.
LIGHT_GREEN: Light green color.
YELLOW: Yellow color.
LIGHT_BLUE: Light blue color.
LIGHT_PURPLE: Light purple color.
LIGHT_CYAN: Light cyan color.
LIGHT_WHITE: Light white color.
BOLD: Bold text.
FAINT: Faint text.
ITALIC: Italic text.
UNDERLINE: Underline text.
BLINK: Blink text.
NEGATIVE: Negative text.
CROSSED: Crossed text.
END: Reset color.
"""

BLACK = "\033[0;30m"
RED = "\033[0;31m"
Expand Down
Loading