From 9dd5052dff632155ae6a4e13e30f89696d1a7aea Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Fri, 29 May 2020 14:38:13 +0100 Subject: [PATCH] [FIX] README template section levels The README generation could return an error like this: docutils.utils.SystemMessage: account_avatax/README.rst:349: (SEVERE/4) Title level inconsistent: Authors ~~~~~~~ In fact the Authors section is inside a Credits first level title, ``====``, and should be a second level title, ``----``, instead of a third level, ``~~~``. --- tests/data/readme_tests/addon1/README.expected-acme | 8 ++++---- tests/data/readme_tests/addon1/README.expected-oca | 8 ++++---- .../addon_one_maintainer/README.expected-acme | 4 ++-- .../readme_tests/addon_one_maintainer/README.expected-oca | 4 ++-- .../addon_two_maintainers/README.expected-acme | 4 ++-- .../addon_two_maintainers/README.expected-oca | 4 ++-- tools/gen_addon_readme.template | 8 ++++---- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/data/readme_tests/addon1/README.expected-acme b/tests/data/readme_tests/addon1/README.expected-acme index 720569353..1bc966d33 100644 --- a/tests/data/readme_tests/addon1/README.expected-acme +++ b/tests/data/readme_tests/addon1/README.expected-acme @@ -86,23 +86,23 @@ Credits ======= Authors -~~~~~~~ +------- * Acme Inc Contributors -~~~~~~~~~~~~ +------------ * contributor1 * contributor2 Other credits -~~~~~~~~~~~~~ +------------- This module has been funded by Acme Corp. Maintainers -~~~~~~~~~~~ +----------- This module is part of the `acme/server-tools `_ project on GitHub. diff --git a/tests/data/readme_tests/addon1/README.expected-oca b/tests/data/readme_tests/addon1/README.expected-oca index d5791e629..048268d00 100644 --- a/tests/data/readme_tests/addon1/README.expected-oca +++ b/tests/data/readme_tests/addon1/README.expected-oca @@ -92,23 +92,23 @@ Credits ======= Authors -~~~~~~~ +------- * Acme Inc Contributors -~~~~~~~~~~~~ +------------ * contributor1 * contributor2 Other credits -~~~~~~~~~~~~~ +------------- This module has been funded by Acme Corp. Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. diff --git a/tests/data/readme_tests/addon_one_maintainer/README.expected-acme b/tests/data/readme_tests/addon_one_maintainer/README.expected-acme index 14763dd8a..cb7bd9cda 100644 --- a/tests/data/readme_tests/addon_one_maintainer/README.expected-acme +++ b/tests/data/readme_tests/addon_one_maintainer/README.expected-acme @@ -47,12 +47,12 @@ Credits ======= Authors -~~~~~~~ +------- * Acme Inc Maintainers -~~~~~~~~~~~ +----------- .. |maintainer-toto| image:: https://github.com/toto.png?size=40px :target: https://github.com/toto diff --git a/tests/data/readme_tests/addon_one_maintainer/README.expected-oca b/tests/data/readme_tests/addon_one_maintainer/README.expected-oca index 4d462ac35..72138b56b 100644 --- a/tests/data/readme_tests/addon_one_maintainer/README.expected-oca +++ b/tests/data/readme_tests/addon_one_maintainer/README.expected-oca @@ -53,12 +53,12 @@ Credits ======= Authors -~~~~~~~ +------- * Acme Inc Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. diff --git a/tests/data/readme_tests/addon_two_maintainers/README.expected-acme b/tests/data/readme_tests/addon_two_maintainers/README.expected-acme index 317308708..106ff5281 100644 --- a/tests/data/readme_tests/addon_two_maintainers/README.expected-acme +++ b/tests/data/readme_tests/addon_two_maintainers/README.expected-acme @@ -40,12 +40,12 @@ Credits ======= Authors -~~~~~~~ +------- * Acme Inc Maintainers -~~~~~~~~~~~ +----------- .. |maintainer-toto| image:: https://github.com/toto.png?size=40px :target: https://github.com/toto diff --git a/tests/data/readme_tests/addon_two_maintainers/README.expected-oca b/tests/data/readme_tests/addon_two_maintainers/README.expected-oca index 4b1c0e197..c05b86452 100644 --- a/tests/data/readme_tests/addon_two_maintainers/README.expected-oca +++ b/tests/data/readme_tests/addon_two_maintainers/README.expected-oca @@ -46,12 +46,12 @@ Credits ======= Authors -~~~~~~~ +------- * Acme Inc Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. diff --git a/tools/gen_addon_readme.template b/tools/gen_addon_readme.template index acfb89c5f..d9eb6d38a 100644 --- a/tools/gen_addon_readme.template +++ b/tools/gen_addon_readme.template @@ -61,17 +61,17 @@ Credits {% if authors -%} Authors -~~~~~~~ +------- {% for author in authors -%} * {{ author }} {% endfor %} {% endif -%} -{{ fragment('CONTRIBUTORS', 'Contributors', sub='~') }} -{{- fragment('CREDITS', 'Other credits', sub='~') -}} +{{ fragment('CONTRIBUTORS', 'Contributors', sub='-') }} +{{- fragment('CREDITS', 'Other credits', sub='-') -}} Maintainers -~~~~~~~~~~~ +----------- {%- if org_name == 'OCA' %} This module is maintained by the OCA.