From 09a845db5733990cfcdac8ad126b054c5b50257e Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Thu, 9 Jan 2025 10:16:53 +0100 Subject: [PATCH] Add a few dotfiles to improve newcomers' experience --- .editorconfig | 15 +++++++++++++++ .pre-commit-config.yaml | 10 ++++++++++ .pydocstyle | 2 ++ .vscode/settings.json | 7 +++++++ pyproject.toml | 4 ++++ 5 files changed, 38 insertions(+) create mode 100644 .editorconfig create mode 100644 .pydocstyle create mode 100644 .vscode/settings.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..e795376f7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.yaml] +indent_size = 2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9039b605..f09fa2b98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,3 +31,13 @@ repos: args: [--allow-redefinition] exclude: ^examples/ additional_dependencies: [types-tqdm, types-Pillow] +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.8.6 + hooks: + - id: ruff + args: ["--config=pyproject.toml"] +# - repo: https://github.com/PyCQA/docformatter +# rev: v1.7.5 +# hooks: +# - id: docformatter +# args: ["--in-place", "--style=numpy"] diff --git a/.pydocstyle b/.pydocstyle new file mode 100644 index 000000000..6663458d8 --- /dev/null +++ b/.pydocstyle @@ -0,0 +1,2 @@ +[pydocstyle] +convention = numpy diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..a3a183836 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "python.testing.pytestArgs": [ + "tests" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} diff --git a/pyproject.toml b/pyproject.toml index 28060f797..ab41f9cd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -172,3 +172,7 @@ show_missing = true [tool.diff_cover] compare_branch = "origin/main" diff_range_notation = ".." + +[tool.docformatter] +style = "numpy" +in-place = true