From 59a2b92506de3c45a9418720ba4c9cfd28097602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20Lou=C3=ABt?= Date: Fri, 19 Jul 2024 08:54:48 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Update=20the=20pytest=20environm?= =?UTF-8?q?ent=20and=20add=20various=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/{toolbox.md => index.md} | 4 +- docs/utils_bash.md | 61 ------------ mkdocs.yml | 4 +- poetry.lock | 179 +++++++++++++++++++++++++++------- pyproject.toml | 2 +- tests/test_toolbox.py | 20 ++-- toolbox.Dockerfile | 10 +- toolbox.sh | 3 +- utils.sh | 2 + utils_bash.sh | 6 +- 10 files changed, 168 insertions(+), 123 deletions(-) rename docs/{toolbox.md => index.md} (95%) delete mode 100644 docs/utils_bash.md diff --git a/docs/toolbox.md b/docs/index.md similarity index 95% rename from docs/toolbox.md rename to docs/index.md index 65fb7e3..0ce65c0 100644 --- a/docs/toolbox.md +++ b/docs/index.md @@ -1,7 +1,5 @@ # toolbox.sh -**toolbox.sh** is a utility script for installing the SonarQube dev environment. - ## Overview This toolbox enables you to install the SonarQube dev environment. @@ -127,7 +125,7 @@ Create a push and a new branch with commits previously prepared #### Exit codes * **0**: If successful. -* **1**: If an error is encountered when push the release. +* **1**: If the last commit tag does not match the last git tag. ### display_help diff --git a/docs/utils_bash.md b/docs/utils_bash.md deleted file mode 100644 index 86b2560..0000000 --- a/docs/utils_bash.md +++ /dev/null @@ -1,61 +0,0 @@ -# utils_bash.sh - -**utils_bash.sh** is a utility script for the toolbox.sh. - -## Overview - -This utility script enables you to perform the following actions: - -* Run unit tests with **pytest** -* Linter the code with the **shellcheck** utility -* Generating the API documentation with the **shdoc** utility -* Generating a site from markdown files with **mkdocs** - -## Index - -* [unit_tests](#unittests) -* [lint](#lint) -* [generate_doc](#generatedoc) -* [mkdocs_server_start](#mkdocsserverstart) -* [display_help](#displayhelp) - -### unit_tests - -Run unit tests. - -#### Exit codes - -* **0**: If successful. - -### lint - -Linter the application's bash code. - -#### Exit codes - -* **0**: If successful. - -### generate_doc - -Generate API documentation in markdown format. - -#### Exit codes - -* **0**: If successful. - -### mkdocs_server_start - -Start the mkdocs server to browse the API documentation in a browser. - -#### Exit codes - -* **0**: If successful. - -### display_help - -Display help. - -#### Exit codes - -* **0**: If successful. - diff --git a/mkdocs.yml b/mkdocs.yml index 5ea7950..a959630 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,9 +2,7 @@ site_name: ecoCode-java repo_url: https://github.com/green-code-initiative/ecoCode-java/ site_description: Documentation based on ecoCode bash scripts nav: - - Home: - - toolbox.md - - utils_bash.md + - index.md theme: name: material palette: diff --git a/poetry.lock b/poetry.lock index 8b21a07..aa11155 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,23 @@ -# This file is automatically @generated by Poetry 1.8.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. + +[[package]] +name = "attrs" +version = "23.2.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.7" +files = [ + {file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"}, + {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, +] + +[package.extras] +cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] +dev = ["attrs[tests]", "pre-commit"] +docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] +tests = ["attrs[tests-no-zope]", "zope-interface"] +tests-mypy = ["mypy (>=1.6)", "pytest-mypy-plugins"] +tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist[psutil]"] [[package]] name = "babel" @@ -149,6 +168,17 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "distro" +version = "1.9.0" +description = "Distro - an OS platform information API" +optional = false +python-versions = ">=3.6" +files = [ + {file = "distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2"}, + {file = "distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"}, +] + [[package]] name = "ghp-import" version = "2.1.0" @@ -188,17 +218,6 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] -[[package]] -name = "itermate" -version = "1.0.2" -description = "Iterator-tools for functional programming." -optional = false -python-versions = "*" -files = [ - {file = "itermate-1.0.2-py2-none-any.whl", hash = "sha256:00308991e0fe54465e0e0fbec4d47180b4f6df0f26c1e5d2ce3641e3373f28a0"}, - {file = "itermate-1.0.2.zip", hash = "sha256:5ee758cbb363493156cee7a29effc2b148a1a19d2be3097e92fc824991901e2a"}, -] - [[package]] name = "jinja2" version = "3.1.4" @@ -474,6 +493,35 @@ files = [ dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "psutil" +version = "6.0.0" +description = "Cross-platform lib for process and system monitoring in Python." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +files = [ + {file = "psutil-6.0.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a021da3e881cd935e64a3d0a20983bda0bb4cf80e4f74fa9bfcb1bc5785360c6"}, + {file = "psutil-6.0.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:1287c2b95f1c0a364d23bc6f2ea2365a8d4d9b726a3be7294296ff7ba97c17f0"}, + {file = "psutil-6.0.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:a9a3dbfb4de4f18174528d87cc352d1f788b7496991cca33c6996f40c9e3c92c"}, + {file = "psutil-6.0.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:6ec7588fb3ddaec7344a825afe298db83fe01bfaaab39155fa84cf1c0d6b13c3"}, + {file = "psutil-6.0.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:1e7c870afcb7d91fdea2b37c24aeb08f98b6d67257a5cb0a8bc3ac68d0f1a68c"}, + {file = "psutil-6.0.0-cp27-none-win32.whl", hash = "sha256:02b69001f44cc73c1c5279d02b30a817e339ceb258ad75997325e0e6169d8b35"}, + {file = "psutil-6.0.0-cp27-none-win_amd64.whl", hash = "sha256:21f1fb635deccd510f69f485b87433460a603919b45e2a324ad65b0cc74f8fb1"}, + {file = "psutil-6.0.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:c588a7e9b1173b6e866756dde596fd4cad94f9399daf99ad8c3258b3cb2b47a0"}, + {file = "psutil-6.0.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ed2440ada7ef7d0d608f20ad89a04ec47d2d3ab7190896cd62ca5fc4fe08bf0"}, + {file = "psutil-6.0.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fd9a97c8e94059b0ef54a7d4baf13b405011176c3b6ff257c247cae0d560ecd"}, + {file = "psutil-6.0.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e2e8d0054fc88153ca0544f5c4d554d42e33df2e009c4ff42284ac9ebdef4132"}, + {file = "psutil-6.0.0-cp36-cp36m-win32.whl", hash = "sha256:fc8c9510cde0146432bbdb433322861ee8c3efbf8589865c8bf8d21cb30c4d14"}, + {file = "psutil-6.0.0-cp36-cp36m-win_amd64.whl", hash = "sha256:34859b8d8f423b86e4385ff3665d3f4d94be3cdf48221fbe476e883514fdb71c"}, + {file = "psutil-6.0.0-cp37-abi3-win32.whl", hash = "sha256:a495580d6bae27291324fe60cea0b5a7c23fa36a7cd35035a16d93bdcf076b9d"}, + {file = "psutil-6.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:33ea5e1c975250a720b3a6609c490db40dae5d83a4eb315170c4fe0d8b1f34b3"}, + {file = "psutil-6.0.0-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:ffe7fc9b6b36beadc8c322f84e1caff51e8703b88eee1da46d1e3a6ae11b4fd0"}, + {file = "psutil-6.0.0.tar.gz", hash = "sha256:8faae4f310b6d969fa26ca0545338b21f73c6b15db7c4a8d934a5482faa818f2"}, +] + +[package.extras] +test = ["enum34", "ipaddress", "mock", "pywin32", "wmi"] + [[package]] name = "pygments" version = "2.18.0" @@ -527,18 +575,72 @@ pluggy = ">=1.5,<2.0" dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] [[package]] -name = "pytest-shell" -version = "0.3.2" -description = "A pytest plugin to help with testing shell scripts / black box commands" +name = "pytest-helpers-namespace" +version = "2021.12.29" +description = "Pytest Helpers Namespace Plugin" optional = false -python-versions = ">=3.7,<4.0" +python-versions = ">=3.5.6" files = [ - {file = "pytest-shell-0.3.2.tar.gz", hash = "sha256:7e30cf518a5271328f25eaa9013e1639607f169d7396a4b85204a8b34dacbab1"}, - {file = "pytest_shell-0.3.2-py3-none-any.whl", hash = "sha256:f60716134fc30e2c1fe9facb9fe60121d18b4d7b95e692b2c6f29271350aa12b"}, + {file = "pytest-helpers-namespace-2021.12.29.tar.gz", hash = "sha256:792038247e0021beb966a7ea6e3a70ff5fcfba77eb72c6ec8fd6287af871c35b"}, + {file = "pytest_helpers_namespace-2021.12.29-py3-none-any.whl", hash = "sha256:d5c0262642998437a73d85cb6ae0db57d574facc551c4a4695e92ec50469eb98"}, ] [package.dependencies] -where = ">=1.0.2,<2.0.0" +pytest = ">=6.0.0" + +[package.extras] +changelog = ["towncrier (==21.9.0rc1)"] +docs = ["furo", "sphinx", "sphinx-copybutton", "sphinx-prompt", "sphinxcontrib-spelling", "sphinxcontrib-towncrier (>=0.2.0a0)", "towncrier (==21.3.0)"] +lint = ["black", "pyenchant", "pylint (==2.12.2)", "reorder-python-imports"] + +[[package]] +name = "pytest-shell-utilities" +version = "1.9.0" +description = "Pytest plugin to simplify running shell commands against the system" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-shell-utilities-1.9.0.tar.gz", hash = "sha256:e9ae85f8c64dd2b95e35ed1f110a90e25d498cb1af946be7cf1b7f069c089499"}, + {file = "pytest_shell_utilities-1.9.0-py3-none-any.whl", hash = "sha256:6c05c90cc8bc04fe4e3cbe342acfff5559f88816d1d20c80e7713895cc79687c"}, +] + +[package.dependencies] +attrs = ">=22.1.0" +psutil = ">=5.0.0" +pytest = ">=7.4.0" +pytest-helpers-namespace = "*" +pytest-skip-markers = "*" + +[package.extras] +changelog = ["towncrier (==21.9.0rc1)"] +docs = ["furo", "sphinx", "sphinx-copybutton", "sphinx-prompt", "sphinxcontrib-spelling", "sphinxcontrib-towncrier (>=0.2.1a0)"] +lint = ["black", "flake8 (>=4.0.1)", "flake8-docstrings", "flake8-mypy-fork", "flake8-typing-imports", "pyenchant", "pylint (==2.12.2)", "reorder-python-imports"] +tests = ["pytest-skip-markers", "pytest-subtests"] + +[[package]] +name = "pytest-skip-markers" +version = "1.5.1" +description = "Pytest Salt Plugin" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-skip-markers-1.5.1.tar.gz", hash = "sha256:b208b6b804a320691f9e3a0d0721345a8710b9791c4324499294b6a8e4b0e82b"}, + {file = "pytest_skip_markers-1.5.1-py3-none-any.whl", hash = "sha256:9e3f5ede6e1e6d6dc65e83136e9335abe7d5c4f2f55b94b4fb83d3da5b8d8f0c"}, +] + +[package.dependencies] +attrs = ">=19.2.0" +distro = "*" +pytest = ">=7.1.0" +pywin32 = {version = "*", markers = "sys_platform == \"win32\""} + +[package.extras] +changelog = ["towncrier (==21.9.0rc1)"] +docker = ["docker"] +docs = ["furo", "sphinx", "sphinx-copybutton", "sphinx-prompt", "sphinxcontrib-spelling", "sphinxcontrib-towncrier (>=0.2.1a0)"] +lint = ["black", "flake8 (>=4.0.1)", "flake8-docstrings", "flake8-mypy-fork", "flake8-typing-imports", "pyenchant", "pylint (==2.12.2)", "reorder-python-imports"] +salt = ["salt (>=3001)"] +tests = ["cryptography", "docker", "pyfakefs", "pyfakefs (==4.4.0)", "pytest-subtests"] [[package]] name = "python-dateutil" @@ -554,6 +656,29 @@ files = [ [package.dependencies] six = ">=1.5" +[[package]] +name = "pywin32" +version = "306" +description = "Python for Window Extensions" +optional = false +python-versions = "*" +files = [ + {file = "pywin32-306-cp310-cp310-win32.whl", hash = "sha256:06d3420a5155ba65f0b72f2699b5bacf3109f36acbe8923765c22938a69dfc8d"}, + {file = "pywin32-306-cp310-cp310-win_amd64.whl", hash = "sha256:84f4471dbca1887ea3803d8848a1616429ac94a4a8d05f4bc9c5dcfd42ca99c8"}, + {file = "pywin32-306-cp311-cp311-win32.whl", hash = "sha256:e65028133d15b64d2ed8f06dd9fbc268352478d4f9289e69c190ecd6818b6407"}, + {file = "pywin32-306-cp311-cp311-win_amd64.whl", hash = "sha256:a7639f51c184c0272e93f244eb24dafca9b1855707d94c192d4a0b4c01e1100e"}, + {file = "pywin32-306-cp311-cp311-win_arm64.whl", hash = "sha256:70dba0c913d19f942a2db25217d9a1b726c278f483a919f1abfed79c9cf64d3a"}, + {file = "pywin32-306-cp312-cp312-win32.whl", hash = "sha256:383229d515657f4e3ed1343da8be101000562bf514591ff383ae940cad65458b"}, + {file = "pywin32-306-cp312-cp312-win_amd64.whl", hash = "sha256:37257794c1ad39ee9be652da0462dc2e394c8159dfd913a8a4e8eb6fd346da0e"}, + {file = "pywin32-306-cp312-cp312-win_arm64.whl", hash = "sha256:5821ec52f6d321aa59e2db7e0a35b997de60c201943557d108af9d4ae1ec7040"}, + {file = "pywin32-306-cp37-cp37m-win32.whl", hash = "sha256:1c73ea9a0d2283d889001998059f5eaaba3b6238f767c9cf2833b13e6a685f65"}, + {file = "pywin32-306-cp37-cp37m-win_amd64.whl", hash = "sha256:72c5f621542d7bdd4fdb716227be0dd3f8565c11b280be6315b06ace35487d36"}, + {file = "pywin32-306-cp38-cp38-win32.whl", hash = "sha256:e4c092e2589b5cf0d365849e73e02c391c1349958c5ac3e9d5ccb9a28e017b3a"}, + {file = "pywin32-306-cp38-cp38-win_amd64.whl", hash = "sha256:e8ac1ae3601bee6ca9f7cb4b5363bf1c0badb935ef243c4733ff9a393b1690c0"}, + {file = "pywin32-306-cp39-cp39-win32.whl", hash = "sha256:e25fd5b485b55ac9c057f67d94bc203f3f6595078d1fb3b458c9c28b7153a802"}, + {file = "pywin32-306-cp39-cp39-win_amd64.whl", hash = "sha256:39b61c15272833b5c329a2989999dcae836b1eed650252ab1b7bfbe1d59f30f4"}, +] + [[package]] name = "pyyaml" version = "6.0.1" @@ -809,21 +934,7 @@ files = [ [package.extras] watchmedo = ["PyYAML (>=3.10)"] -[[package]] -name = "where" -version = "1.0.2" -description = "Locates absolute file paths like the Windows 'where' or the Linux 'which' utility.\nMakes use of the PATH variable and the current directory." -optional = false -python-versions = "*" -files = [ - {file = "where-1.0.2-py2.py3-none-any.whl", hash = "sha256:66abc8edf95be7516e949d08a771f25acacff708ef481618562ab484fe5bc63e"}, - {file = "where-1.0.2.zip", hash = "sha256:325ef3a492a26189a47819f7375bc146887d39edd36fce132e86514334803fb1"}, -] - -[package.dependencies] -itermate = "1.0.2" - [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "e108aa3806e59c2d057cedcce2ead4ac6aa3dd0654fa366cbc781fec439a384a" +content-hash = "fdf2ec53a4820aaf070a55cd5377d1307ced015136a5dfad3470ea63a1d98741" diff --git a/pyproject.toml b/pyproject.toml index 481e510..f77b309 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,4 +21,4 @@ mkdocs-include-dir-to-nav = "^1.2.0" [tool.poetry.group.test] [tool.poetry.group.test.dependencies] pytest = "^8.2.2" -pytest-shell = "^0.3.2" +pytest-shell-utilities = "^1.9.0" diff --git a/tests/test_toolbox.py b/tests/test_toolbox.py index 86c302f..f19e7dd 100644 --- a/tests/test_toolbox.py +++ b/tests/test_toolbox.py @@ -1,16 +1,16 @@ import inspect import os +import pytest +import unittest -current_dir: str = "./" -if os.getenv('ENV') == "docker": + +current_dir: str = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) +if os.environ['HOME'] == "/app": current_dir = "/app/tests" -else: - current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) -script: str = os.path.abspath(f"{current_dir}/../toolbox.sh") +script: str = os.path.abspath(f"{current_dir}/../toolbox.sh") -def test_function_not_exist(bash): - with bash() as s: - s.auto_return_code_error = False - assert s.run_script(script, ['test_function']) == "Function with name test_function does not exist" - assert s.last_return_code == 1 +def test_function_not_exist(shell): + ret = shell.run(script, "test_function") + assert ret.returncode == 1 + assert "Function with name test_function does not exist" in ret.stderr diff --git a/toolbox.Dockerfile b/toolbox.Dockerfile index 14155c4..7553c65 100644 --- a/toolbox.Dockerfile +++ b/toolbox.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-alpine3.20 as builder +FROM python:3.12-alpine3.20 AS builder ENV POETRY_NO_INTERACTION=1 \ POETRY_VIRTUALENVS_IN_PROJECT=1 \ @@ -9,15 +9,15 @@ ENV POETRY_NO_INTERACTION=1 \ PYTHONHASHSEED=random \ PIP_DISABLE_PIP_VERSION_CHECK=on \ PIP_DEFAULT_TIMEOUT=100 \ - POETRY_VERSION=1.7.1 + POETRY_VERSION=1.8.3 RUN pip install "poetry==$POETRY_VERSION" -RUN apk add --update --no-cache gcc libc-dev +RUN apk add --update --no-cache gcc libc-dev musl-dev linux-headers python3-dev WORKDIR /app COPY pyproject.toml poetry.lock ./ RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --no-root --no-ansi -FROM python:3.12-alpine3.20 as runtime +FROM python:3.12-alpine3.20 AS runtime ENV VIRTUAL_ENV=/app/.venv \ PATH="/app/.venv/bin:$PATH" @@ -32,7 +32,7 @@ RUN make install -C /tmp/shdoc # Create user RUN addgroup -g 1000 app \ - && adduser -G app -u 1000 app -D + && adduser --home /app -G app -u 1000 app -D USER app WORKDIR /app diff --git a/toolbox.sh b/toolbox.sh index 8897200..271ab72 100755 --- a/toolbox.sh +++ b/toolbox.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash # @name toolbox.sh -# @brief **toolbox.sh** is a utility script for installing the SonarQube dev environment. # @description # This toolbox enables you to install the SonarQube dev environment. @@ -32,7 +31,7 @@ function debug() { } function error() { - echo -e "${COLORS[RED]}$*${COLORS[NOCOLOR]}" + >&2 echo -e "${COLORS[RED]}$*${COLORS[NOCOLOR]}" return 0 } diff --git a/utils.sh b/utils.sh index de7861b..f48dafc 100755 --- a/utils.sh +++ b/utils.sh @@ -24,6 +24,8 @@ function docker_run() { -v "$(pwd)/toolbox.sh:/app/toolbox.sh" \ -v "$(pwd)/utils_bash.sh:/app/utils_bash.sh" \ -v "$(pwd)/.default.docker.env:/app/.default.docker.env" \ + -v "$(pwd)/pom.xml:/app/pom.xml" \ + -v "$(pwd)/pytest.ini:/app/pytest.ini" \ -v "$(pwd)/mkdocs.yml:/app/mkdocs.yml" \ -v "$(pwd)/docs:/app/docs" \ -v "$(pwd)/tests:/app/tests" \ diff --git a/utils_bash.sh b/utils_bash.sh index 474ddd0..c60c8e5 100755 --- a/utils_bash.sh +++ b/utils_bash.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash # @name utils_bash.sh -# @brief **utils_bash.sh** is a utility script for the toolbox.sh. # @description # This utility script enables you to perform the following actions: # @@ -37,7 +36,7 @@ function debug() { # Display an error message. function error() { - echo -e "${COLORS[RED]}$*${COLORS[NOCOLOR]}" + >&2 echo -e "${COLORS[RED]}$*${COLORS[NOCOLOR]}" return 0 } @@ -61,8 +60,7 @@ function lint() { # @exitcode 0 If successful. function generate_doc() { info "Generating the toolbox API documentation" - shdoc < "$CURRENT_PATH/toolbox.sh" > "$DOC_PATH/toolbox.md" - shdoc < "$CURRENT_PATH/utils_bash.sh" > "$DOC_PATH/utils_bash.md" + shdoc < "$CURRENT_PATH/toolbox.sh" > "$DOC_PATH/index.md" return 0 }