From de32e352b00b24e2491caafe95744c0d2999d654 Mon Sep 17 00:00:00 2001 From: Bruno Bernard Date: Fri, 29 Sep 2023 11:02:15 +0400 Subject: [PATCH 1/3] topotato: add darglint2 and pydoclint for sphinx linting on documentation Signed-off-by: Bruno Bernard --- .darglint2 | 4 ++++ .pre-commit-config.yaml | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .darglint2 diff --git a/.darglint2 b/.darglint2 new file mode 100644 index 000000000000..8a095a663485 --- /dev/null +++ b/.darglint2 @@ -0,0 +1,4 @@ +[darglint2] +message_template={path}:{line} -> (in {obj}) {msg} +docstring_style=sphinx +strictness=short \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4f9ba4e2bdf9..4d1382b8e593 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,3 +28,18 @@ repos: require_serial: true pass_filenames: false files: ^topotato/.*\.py$ + +- repo: https://github.com/jsh9/pydoclint # for classes + rev: 0.3.2 + hooks: + - id: pydoclint + require_serial: true + args: + - --style=sphinx + files: ^topotato/.*\.py$ + +- repo: https://github.com/akaihola/darglint2 # for functions has it has no class validation for now + rev: v1.8.2 + hooks: + - id: darglint2 + files: ^topotato/.*\.py$ From 32b0c76d7840bf3fb25fcdc7b1cfa352af8a2478 Mon Sep 17 00:00:00 2001 From: Bruno Bernard Date: Fri, 29 Sep 2023 11:04:16 +0400 Subject: [PATCH 2/3] topotato: added end of line Signed-off-by: Bruno Bernard --- .darglint2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.darglint2 b/.darglint2 index 8a095a663485..4a1e00a7ca3b 100644 --- a/.darglint2 +++ b/.darglint2 @@ -1,4 +1,4 @@ [darglint2] message_template={path}:{line} -> (in {obj}) {msg} docstring_style=sphinx -strictness=short \ No newline at end of file +strictness=short From 8a439b7cd87cc9a4d22f43fe7223a3bd9572743e Mon Sep 17 00:00:00 2001 From: Bruno Bernard Date: Fri, 29 Sep 2023 11:14:19 +0400 Subject: [PATCH 3/3] topoato: add verbosity to darglint2 Signed-off-by: Bruno Bernard --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4d1382b8e593..292fbf1c8623 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,4 +42,6 @@ repos: rev: v1.8.2 hooks: - id: darglint2 + args: + - -v2 files: ^topotato/.*\.py$