diff --git a/.gitignore b/.gitignore index 1df4005..e27cc2c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ test_* .vscode/settings.json *.psd todo -autodocstring-*.vsix +autodocstring*.vsix diff --git a/.vscodeignore b/.vscodeignore index c413bc2..a22e208 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -8,3 +8,4 @@ vsc-extension-quickstart.md **/tslint.json **/*.map **/*.ts +**/*.vsix diff --git a/CHANGELOG.md b/CHANGELOG.md index f38db15..fd6a167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ [All Changes](https://github.com/NilsJPWerner/autoDocstring/compare/v0.6.1...master) +## [0.6.4](https://github.com/sunipkm/autoDocstring/tree/v0.6.4) - 2024-03-11 +- Added the `google-assert` style file and made it default. +- `google-assert` adds markdown for subgroups (e.g. args, returns) as Heading 3, and lists arguments, returns etc. +- Assertions now support statements starting with parenthesis. + ## [0.6.1](https://github.com/NilsJPWerner/autoDocstring/tree/v0.6.1) - 2022-02-15 - Rename oneline-rst to one-line-sphinx diff --git a/README.md b/README.md index f2f25fe..b1d05b1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ -[![Installs](https://vsmarketplacebadge.apphb.com/installs-short/njpwerner.autodocstring.svg)](https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring) -[![Rating](https://vsmarketplacebadge.apphb.com/rating-short/njpwerner.autodocstring.svg)](https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring&ssr=false#review-details) -[![Build Status](https://github.com/NilsJPWerner/autoDocstring/actions/workflows/test_and_publish.yml/badge.svg)](https://github.com/NilsJPWerner/autoDocstring/actions/workflows/test_and_publish.yml) -[![Github Sponsorship](https://img.shields.io/badge/sponsor-5A5A5A?style=flat&logo=GitHub-Sponsors)](https://github.com/sponsors/NilsJPWerner) - -# autoDocstring: VSCode Python Docstring Generator +# autoDocstringPy: A fork of autoDocstring, the VSCode Python Docstring Generator Visual Studio Code extension to quickly generate docstrings for python functions. +This is a fork of the [autoDocstring](https://github.com/NilsJPWerner/autoDocstring) since the original does not appear to be accepting +pull requests, and I really wanted to document `assert` statements used in Python functions. + ![Auto Generate Docstrings](images/demo.gif) @@ -52,7 +50,7 @@ This extension contributes the following settings: ## Custom Docstring Templates -This extension now supports custom templates. The extension uses the [mustache.js](https://github.com/janl/mustache.js/) templating engine. To use a custom template create a .mustache file and specify its path using the `customTemplatePath` configuration. View the included google docstring [template](src/docstring/templates/google.mustache) for a usage example. The following tags are available for use in custom templates. +This extension now supports custom templates. The extension uses the [mustache.js](https://github.com/janl/mustache.js/) templating engine. To use a custom template create a `.mustache` file and specify its path using the `customTemplatePath` configuration. View the included google docstring [template](src/docstring/templates/google.mustache) for a usage example. The following tags are available for use in custom templates. ### Variables @@ -83,6 +81,10 @@ This extension now supports custom templates. The extension uses the [mustache.j {{descriptionPlaceholder}} - _description_ placeholder {{/exceptions}} +{{#assertions}} - iterate over assertions + {{stmt}} - assertion statement +{{/assertions}} + {{#yields}} - iterate over yields {{typePlaceholder}} - _type_ placeholder {{descriptionPlaceholder}} - _description_ placeholder @@ -109,6 +111,9 @@ This extension now supports custom templates. The extension uses the [mustache.j {{#exceptionsExist}} - display contents if exceptions exist {{/exceptionsExist}} +{{#assertionsExist}} - display contents if assertions exist +{{/assertionsExist}} + {{#yieldsExist}} - display contents if returns exist {{/yieldsExist}} @@ -125,13 +130,13 @@ Check the [CHANGELOG.md](CHANGELOG.md) for any version changes. ## Reporting issues -Report any issues on the github [issues](https://github.com/NilsJPWerner/autoDocstring/issues) page. Follow the template and add as much information as possible. +Report any issues on the github [issues](https://github.com/sunipkm/autoDocstring/issues) page. Follow the template and add as much information as possible. ## Contributing -The source code for this extension is hosted on [GitHub](https://github.com/NilsJPWerner/autoDocstring). Contributions, pull requests, suggestions, and bug reports are greatly appreciated. +The source code for this extension is hosted on [GitHub](https://github.com/sunipkm/autoDocstringPy). Contributions, pull requests, suggestions, and bug reports are greatly appreciated. -- Post any issues and suggestions to the github [issues page](https://github.com/NilsJPWerner/autoDocstring/issues). Add the `feature request` tag to any feature requests or suggestions. +- Post any issues and suggestions to the github [issues page](https://github.com/sunipkm/autoDocstring/issues). Add the `feature request` tag to any feature requests or suggestions. - To contribute, fork the project and then create a pull request back to master. Please update the README if you make any noticeable feature changes. - There is no official contribution guide or code of conduct yet, but please follow the standard open source norms and be respectful in any comments you make. diff --git a/images/icon.png b/images/icon.png index 71c51fc..388be92 100644 Binary files a/images/icon.png and b/images/icon.png differ diff --git a/package-lock.json b/package-lock.json index 4c0243f..7a3f0e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "autodocstring", - "version": "0.6.1", + "name": "autodocstringpy", + "version": "0.6.4", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "autodocstring", - "version": "0.6.1", + "name": "autodocstringpy", + "version": "0.6.4", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@types/stack-trace": "^0.0.29", @@ -26,6 +26,7 @@ "@vscode/test-electron": "^2.1.2", "chai": "^4.3.6", "copyfiles": "^2.4.1", + "esbuild": "^0.23.0", "eslint": "^8.9.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.4", @@ -74,6 +75,414 @@ "node": "^12 || ^14 || ^16 || ^17" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", + "integrity": "sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.0.tgz", + "integrity": "sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.0.tgz", + "integrity": "sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.0.tgz", + "integrity": "sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.0.tgz", + "integrity": "sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.0.tgz", + "integrity": "sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.0.tgz", + "integrity": "sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.0.tgz", + "integrity": "sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.0.tgz", + "integrity": "sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.0.tgz", + "integrity": "sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.0.tgz", + "integrity": "sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.0.tgz", + "integrity": "sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.0.tgz", + "integrity": "sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.0.tgz", + "integrity": "sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.0.tgz", + "integrity": "sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.0.tgz", + "integrity": "sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.0.tgz", + "integrity": "sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.0.tgz", + "integrity": "sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.0.tgz", + "integrity": "sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.0.tgz", + "integrity": "sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.0.tgz", + "integrity": "sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.0.tgz", + "integrity": "sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.0.tgz", + "integrity": "sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz", + "integrity": "sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz", @@ -683,12 +1092,13 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1129,6 +1539,46 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esbuild": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz", + "integrity": "sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.0", + "@esbuild/android-arm": "0.23.0", + "@esbuild/android-arm64": "0.23.0", + "@esbuild/android-x64": "0.23.0", + "@esbuild/darwin-arm64": "0.23.0", + "@esbuild/darwin-x64": "0.23.0", + "@esbuild/freebsd-arm64": "0.23.0", + "@esbuild/freebsd-x64": "0.23.0", + "@esbuild/linux-arm": "0.23.0", + "@esbuild/linux-arm64": "0.23.0", + "@esbuild/linux-ia32": "0.23.0", + "@esbuild/linux-loong64": "0.23.0", + "@esbuild/linux-mips64el": "0.23.0", + "@esbuild/linux-ppc64": "0.23.0", + "@esbuild/linux-riscv64": "0.23.0", + "@esbuild/linux-s390x": "0.23.0", + "@esbuild/linux-x64": "0.23.0", + "@esbuild/netbsd-x64": "0.23.0", + "@esbuild/openbsd-arm64": "0.23.0", + "@esbuild/openbsd-x64": "0.23.0", + "@esbuild/sunos-x64": "0.23.0", + "@esbuild/win32-arm64": "0.23.0", + "@esbuild/win32-ia32": "0.23.0", + "@esbuild/win32-x64": "0.23.0" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -1611,10 +2061,11 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1747,9 +2198,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" @@ -2150,6 +2601,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -2303,9 +2755,9 @@ "dev": true }, "node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "dependencies": { "minimist": "^1.2.0" @@ -2432,10 +2884,13 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/mkdirp": { "version": "1.0.4", @@ -2450,9 +2905,9 @@ } }, "node_modules/mocha": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.0.tgz", - "integrity": "sha512-kNn7E8g2SzVcq0a77dkphPsDSN7P+iYkqE0ZsGCYWRsoiKjOt+NvXfaagik8vuDa6W5Zw3qxe8Jfpt5qKf+6/Q==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, "dependencies": { "@ungap/promise-all-settled": "1.1.2", @@ -2468,9 +2923,9 @@ "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", - "minimatch": "3.0.4", + "minimatch": "4.2.1", "ms": "2.1.3", - "nanoid": "3.2.0", + "nanoid": "3.3.1", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", @@ -2493,15 +2948,15 @@ } }, "node_modules/mocha/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, "engines": { - "node": "*" + "node": ">=10" } }, "node_modules/mocha/node_modules/ms": { @@ -2525,9 +2980,9 @@ } }, "node_modules/nanoid": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", - "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -2956,9 +3411,9 @@ ] }, "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3222,6 +3677,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -3513,9 +3969,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3665,6 +4121,174 @@ "jsdoc-type-pratt-parser": "~2.2.2" } }, + "@esbuild/aix-ppc64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", + "integrity": "sha512-3sG8Zwa5fMcA9bgqB8AfWPQ+HFke6uD3h1s3RIwUNK8EG7a4buxvuFTs3j1IMs2NXAk9F30C/FF4vxRgQCcmoQ==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.0.tgz", + "integrity": "sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.0.tgz", + "integrity": "sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.0.tgz", + "integrity": "sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.0.tgz", + "integrity": "sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.0.tgz", + "integrity": "sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.0.tgz", + "integrity": "sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.0.tgz", + "integrity": "sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.0.tgz", + "integrity": "sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.0.tgz", + "integrity": "sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.0.tgz", + "integrity": "sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.0.tgz", + "integrity": "sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.0.tgz", + "integrity": "sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.0.tgz", + "integrity": "sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.0.tgz", + "integrity": "sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.0.tgz", + "integrity": "sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.0.tgz", + "integrity": "sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.0.tgz", + "integrity": "sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.0.tgz", + "integrity": "sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.0.tgz", + "integrity": "sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.0.tgz", + "integrity": "sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.0.tgz", + "integrity": "sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.0.tgz", + "integrity": "sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.0.tgz", + "integrity": "sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==", + "dev": true, + "optional": true + }, "@eslint/eslintrc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz", @@ -4103,12 +4727,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-stdout": { @@ -4449,6 +5073,38 @@ "is-symbol": "^1.0.2" } }, + "esbuild": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz", + "integrity": "sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.23.0", + "@esbuild/android-arm": "0.23.0", + "@esbuild/android-arm64": "0.23.0", + "@esbuild/android-x64": "0.23.0", + "@esbuild/darwin-arm64": "0.23.0", + "@esbuild/darwin-x64": "0.23.0", + "@esbuild/freebsd-arm64": "0.23.0", + "@esbuild/freebsd-x64": "0.23.0", + "@esbuild/linux-arm": "0.23.0", + "@esbuild/linux-arm64": "0.23.0", + "@esbuild/linux-ia32": "0.23.0", + "@esbuild/linux-loong64": "0.23.0", + "@esbuild/linux-mips64el": "0.23.0", + "@esbuild/linux-ppc64": "0.23.0", + "@esbuild/linux-riscv64": "0.23.0", + "@esbuild/linux-s390x": "0.23.0", + "@esbuild/linux-x64": "0.23.0", + "@esbuild/netbsd-x64": "0.23.0", + "@esbuild/openbsd-arm64": "0.23.0", + "@esbuild/openbsd-x64": "0.23.0", + "@esbuild/sunos-x64": "0.23.0", + "@esbuild/win32-arm64": "0.23.0", + "@esbuild/win32-ia32": "0.23.0", + "@esbuild/win32-x64": "0.23.0" + } + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -4833,9 +5489,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -4937,9 +5593,9 @@ "dev": true }, "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true }, "get-intrinsic": { @@ -5322,9 +5978,9 @@ "dev": true }, "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "requires": { "minimist": "^1.2.0" @@ -5421,9 +6077,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true }, "mkdirp": { @@ -5433,9 +6089,9 @@ "dev": true }, "mocha": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.0.tgz", - "integrity": "sha512-kNn7E8g2SzVcq0a77dkphPsDSN7P+iYkqE0ZsGCYWRsoiKjOt+NvXfaagik8vuDa6W5Zw3qxe8Jfpt5qKf+6/Q==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", @@ -5451,9 +6107,9 @@ "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", - "minimatch": "3.0.4", + "minimatch": "4.2.1", "ms": "2.1.3", - "nanoid": "3.2.0", + "nanoid": "3.3.1", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", @@ -5465,9 +6121,9 @@ }, "dependencies": { "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -5493,9 +6149,9 @@ "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" }, "nanoid": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", - "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true }, "natural-compare": { @@ -5773,9 +6429,9 @@ "dev": true }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -6209,9 +6865,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true }, "workerpool": { diff --git a/package.json b/package.json index 91d95e9..0550723 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "autodocstring", - "displayName": "autoDocstring - Python Docstring Generator", + "name": "autodocstringpy", + "displayName": "autoDocstringPy - Python Docstring Generator", "description": "Generates python docstrings automatically", - "version": "0.6.1", - "publisher": "njpwerner", + "version": "0.6.5", + "publisher": "sunipkm", "license": "SEE LICENSE IN LICENSE", "icon": "images/icon.png", "extensionKind": [ @@ -11,10 +11,10 @@ ], "repository": { "type": "git", - "url": "https://github.com/NilsJPWerner/autoDocstring" + "url": "https://github.com/sunipkm/autoDocstring" }, "bugs": { - "url": "https://github.com/NilsJPWerner/autoDocstring/issues" + "url": "https://github.com/sunipkm/autoDocstring/issues" }, "categories": [ "Snippets", @@ -45,13 +45,13 @@ "contributes": { "commands": [ { - "command": "autoDocstring.generateDocstring", + "command": "autoDocstringPy.generateDocstring", "title": "Generate Docstring" } ], "keybindings": [ { - "command": "autoDocstring.generateDocstring", + "command": "autoDocstringPy.generateDocstring", "key": "ctrl+shift+2", "mac": "cmd+shift+2", "when": "editorTextFocus" @@ -61,23 +61,24 @@ "editor/context": [ { "when": "resourceLangId == python", - "command": "autoDocstring.generateDocstring", + "command": "autoDocstringPy.generateDocstring", "group": "1_modification" } ] }, "configuration": { "type": "object", - "title": "Python Docstring Generator configuration", + "title": "PyDocstring Generator configuration", "properties": { - "autoDocstring.docstringFormat": { + "autoDocstringPy.docstringFormat": { "type": "string", - "default": "google", + "default": "google-assert", "enum": [ "docblockr", "pep257", "google", "google-notypes", + "google-assert", "sphinx", "sphinx-notypes", "numpy", @@ -86,37 +87,37 @@ ], "description": "Which docstring format to use." }, - "autoDocstring.customTemplatePath": { + "autoDocstringPy.customTemplatePath": { "type": "string", "default": "", "description": "Path to custom docstring template (overrides docstringFormat). Path can be absolute or relative to the project root." }, - "autoDocstring.generateDocstringOnEnter": { + "autoDocstringPy.generateDocstringOnEnter": { "type": "boolean", "default": true, "description": "Generate docstring on pressing enter after opening a docstring (use quoteStyle)" }, - "autoDocstring.includeExtendedSummary": { + "autoDocstringPy.includeExtendedSummary": { "type": "boolean", "default": false, "description": "Include [extended_summary] tag" }, - "autoDocstring.includeName": { + "autoDocstringPy.includeName": { "type": "boolean", "default": false, "description": "Include function names at the start of docstrings" }, - "autoDocstring.startOnNewLine": { + "autoDocstringPy.startOnNewLine": { "type": "boolean", "default": false, "description": "Start docstring on new line" }, - "autoDocstring.guessTypes": { + "autoDocstringPy.guessTypes": { "type": "boolean", "default": true, "description": "Guess the type of parameters and return values" }, - "autoDocstring.quoteStyle": { + "autoDocstringPy.quoteStyle": { "type": "string", "default": "\"\"\"", "enum": [ @@ -125,7 +126,7 @@ ], "description": "Style of quote used with generate docstring command" }, - "autoDocstring.logLevel": { + "autoDocstringPy.logLevel": { "type": "string", "default": "Info", "enum": [ @@ -162,6 +163,7 @@ "@vscode/test-electron": "^2.1.2", "chai": "^4.3.6", "copyfiles": "^2.4.1", + "esbuild": "^0.23.0", "eslint": "^8.9.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.4", diff --git a/src/constants.ts b/src/constants.ts index 95a23c8..9a1dd78 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -3,5 +3,5 @@ type ExtensionRoot = { path?: string }; export const extensionRoot: ExtensionRoot = { path: "" }; export const debug = false; -export const extensionID = "autoDocstring"; -export const generateDocstringCommand = "autoDocstring.generateDocstring"; +export const extensionID = "autoDocstringPy"; +export const generateDocstringCommand = "autoDocstringPy.generateDocstring"; diff --git a/src/docstring/docstring_factory.ts b/src/docstring/docstring_factory.ts index 381c412..098087d 100644 --- a/src/docstring/docstring_factory.ts +++ b/src/docstring/docstring_factory.ts @@ -2,6 +2,15 @@ import { render } from "mustache"; import { DocstringParts } from "../docstring_parts"; import { TemplateData } from "./template_data"; import { dedent } from "ts-dedent"; +import { unescape } from "querystring"; + +enum HTMLUnEscapeChars { + "&" = "&", + "<" = "<", + ">" = ">", + "'" = "'", + """ = '"', + }; export class DocstringFactory { private template: string; @@ -46,6 +55,35 @@ export class DocstringFactory { docstring = this.commentText(docstring); docstring = this.indentDocstring(docstring, indentation); + docstring = docstring.replace(/&#x?(\w+);/g, (inp: string) => { + const pattern = /&#x(\w*);/; + const match = inp.match(pattern); + if (match == null || match.length < 2) { + return "<" + inp + ">"; + } + return unescape("%" + match[1]); + }); // get all the number encoded ones + docstring = docstring.replace(/&([a-zA-Z]+);/g, (inp: string) => { + /** + * Unescapes escaped HTML characters. + * + * Use `String.prototype.replace()` with a regex that matches the characters that need to be unescaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object). + * @param str + */ + const unescapeHTML = (str: string) => { + type StringMap = { [key: string]: T }; + const htmlUnEscapeReg = new RegExp( + `${Object.keys(HTMLUnEscapeChars).join("|")}`, + "g" + ); + return str.replace( + htmlUnEscapeReg, + (tag: string) => (HTMLUnEscapeChars as StringMap)[tag] || tag + )}; + + return unescapeHTML(inp); + }); // get all the name encoded ones + return docstring; } diff --git a/src/docstring/template_data.ts b/src/docstring/template_data.ts index 2834717..bd4f2d7 100644 --- a/src/docstring/template_data.ts +++ b/src/docstring/template_data.ts @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ import { Argument, + Assertion, Decorator, DocstringParts, Exception, @@ -16,6 +17,7 @@ export class TemplateData { public args: Argument[]; public kwargs: KeywordArgument[]; public exceptions: Exception[]; + public assertions: Assertion[]; public returns: Returns; public yields: Yields; @@ -33,6 +35,7 @@ export class TemplateData { this.args = docstringParts.args; this.kwargs = docstringParts.kwargs; this.exceptions = docstringParts.exceptions; + this.assertions = docstringParts.assertions; this.returns = docstringParts.returns; this.yields = docstringParts.yields; @@ -95,6 +98,10 @@ export class TemplateData { return this.exceptions.length > 0; } + public assertionsExist(): boolean { + return this.assertions.length > 0; + } + public returnsExist(): boolean { return this.returns !== undefined; } diff --git a/src/docstring/templates/google-assert.mustache b/src/docstring/templates/google-assert.mustache new file mode 100644 index 0000000..60c47d0 --- /dev/null +++ b/src/docstring/templates/google-assert.mustache @@ -0,0 +1,42 @@ +{{! Google Docstring Template with Asserts}} +## {{summaryPlaceholder}} + +{{extendedSummaryPlaceholder}} +{{#parametersExist}} + +### Args: +{{#args}} + - `{{var}} ({{typePlaceholder}})`: {{descriptionPlaceholder}} +{{/args}} +{{#kwargs}} + - `{{var}} ({{typePlaceholder}}, optional)`: {{descriptionPlaceholder}}. Defaults to {{&default}}. +{{/kwargs}} +{{/parametersExist}} +{{#assertionsExist}} + +### Asserts: +{{#assertions}} + - `{{stmt}}` +{{/assertions}} +{{/assertionsExist}} +{{#exceptionsExist}} + +### Raises: +{{#exceptions}} + - `{{type}}`: {{descriptionPlaceholder}} +{{/exceptions}} +{{/exceptionsExist}} +{{#returnsExist}} + +### Returns: +{{#returns}} + - `{{typePlaceholder}}`: {{descriptionPlaceholder}} +{{/returns}} +{{/returnsExist}} +{{#yieldsExist}} + +### Yields: +{{#yields}} + - `{{typePlaceholder}}`: {{descriptionPlaceholder}} +{{/yields}} +{{/yieldsExist}} diff --git a/src/docstring/templates/sphinx-assert.mustache b/src/docstring/templates/sphinx-assert.mustache new file mode 100644 index 0000000..9d306aa --- /dev/null +++ b/src/docstring/templates/sphinx-assert.mustache @@ -0,0 +1,27 @@ +{{! Sphinx Docstring Template }} +{{summaryPlaceholder}} + +{{extendedSummaryPlaceholder}} + +{{#args}} +:param {{var}}: {{descriptionPlaceholder}} +:type {{var}}: {{typePlaceholder}} +{{/args}} +{{#kwargs}} +:param {{var}}: {{descriptionPlaceholder}}, defaults to {{&default}} +:type {{var}}: {{typePlaceholder}}, optional +{{/kwargs}} +{{#exceptions}} +:raises {{type}}: {{descriptionPlaceholder}} +{{/exceptions}} +{{#assertions}} +:asserts {{stmt}} +{{/assertions}} +{{#returns}} +:return: {{descriptionPlaceholder}} +:rtype: {{typePlaceholder}} +{{/returns}} +{{#yields}} +:yield: {{descriptionPlaceholder}} +:rtype: {{typePlaceholder}} +{{/yields}} diff --git a/src/docstring_parts.ts b/src/docstring_parts.ts index 7083885..23aafc6 100644 --- a/src/docstring_parts.ts +++ b/src/docstring_parts.ts @@ -6,6 +6,7 @@ export interface DocstringParts { args: Argument[]; kwargs: KeywordArgument[]; exceptions: Exception[]; + assertions: Assertion[]; returns: Returns; yields: Yields; } @@ -29,6 +30,10 @@ export interface Exception { type: string; } +export interface Assertion { + stmt: string; +} + export interface Returns { type: string; } @@ -50,6 +55,9 @@ export function docstringPartsToString(docstringParts: DocstringParts): string { const exceptionsText = docstringParts.exceptions.length ? docstringParts.exceptions.map((exception) => `${exception.type}`).join("\n") : "N/A"; + const assertionsText = docstringParts.assertions.length + ? docstringParts.assertions.map((assertion) => `${assertion.stmt}`).join("\n") + : "N/A"; const returnsText = `${docstringParts.returns?.type ?? "N/A"}`; const yieldsText = `${docstringParts.yields?.type ?? "N/A"}`; @@ -65,6 +73,8 @@ export function docstringPartsToString(docstringParts: DocstringParts): string { ${kwargsText} Exceptions: ${exceptionsText} + Assertions: + ${assertionsText} Returns: ${returnsText} Yields: diff --git a/src/extension.ts b/src/extension.ts index dbbc85a..8ba80a9 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -11,10 +11,10 @@ export function activate(context: vs.ExtensionContext): void { context.subscriptions.push( vs.commands.registerCommand(generateDocstringCommand, () => { const editor = vs.window.activeTextEditor; - const autoDocstring = new AutoDocstring(editor); + const autoDocstringPy = new AutoDocstring(editor); try { - return autoDocstring.generateDocstring(); + return autoDocstringPy.generateDocstring(); } catch (error) { const errorString = JSON.stringify(error); let stackTrace = ""; diff --git a/src/parse/parse_parameters.ts b/src/parse/parse_parameters.ts index 886d5e2..b8a8dbe 100644 --- a/src/parse/parse_parameters.ts +++ b/src/parse/parse_parameters.ts @@ -4,6 +4,7 @@ import { Decorator, DocstringParts, Exception, + Assertion, KeywordArgument, Returns, Yields, @@ -22,6 +23,7 @@ export function parseParameters( returns: parseReturn(parameterTokens, body), yields: parseYields(parameterTokens, body), exceptions: parseExceptions(body), + assertions: parseAssertions(body), }; } @@ -148,6 +150,23 @@ function parseExceptions(body: string[]): Exception[] { return exceptions; } +function parseAssertions(body: string[]): Assertion[] { + const assertions: Assertion[] = []; + const pattern = /(?(item: type, array: type[]) { return array.some((x) => item === x); } diff --git a/src/test/docstring/generate_docstring.spec.ts b/src/test/docstring/generate_docstring.spec.ts index c557ffe..0e4e285 100644 --- a/src/test/docstring/generate_docstring.spec.ts +++ b/src/test/docstring/generate_docstring.spec.ts @@ -118,6 +118,17 @@ describe("DocstringFactory", () => { expect(result).to.equal('"""Error_1\nError_2\n"""'); }); + it("should iterate over docstring assertions components", () => { + const template = "{{#assertions}}\n{{type}}\n{{/assertions}}"; + const docstringComponents = defaultDocstringComponents; + docstringComponents.assertions = [{ stmt: "assertion_1" }, { stmt: "assertion_2" }]; + const factory = new DocstringFactory(template); + + const result = factory.generateDocstring(docstringComponents); + + expect(result).to.equal('"""assertion_1\nassertion_2\n"""'); + }); + it("should use the docstring returns if the template specifies it", () => { const template = "{{returns.type}} yay"; const docstringComponents = defaultDocstringComponents; @@ -399,6 +410,34 @@ describe("DocstringFactory", () => { }); }); + context("when the assertionsExist tag is used", () => { + const template = "{{#assertionsExist}}Assertions Exist!{{/assertionsExist}}"; + + context("and there are assertions", () => { + it("should include the content inside the tag", () => { + const docstringComponents = defaultDocstringComponents; + docstringComponents.assertions = [{ stmt: "assertion_1" }, { stmt: "assertion_2" }]; + const factory = new DocstringFactory(template); + + const result = factory.generateDocstring(docstringComponents); + + expect(result).to.equal('"""Assertions Exist!"""'); + }); + }); + + context("and there are no assertions", () => { + it("should not include the content inside the tag", () => { + const docstringComponents = defaultDocstringComponents; + docstringComponents.assertions = []; + const factory = new DocstringFactory(template); + + const result = factory.generateDocstring(docstringComponents); + + expect(result).to.equal('""""""'); + }); + }); + }); + context("when the returnsExist tag is used", () => { const template = "{{#returnsExist}}Returns Exist!{{/returnsExist}}"; @@ -461,6 +500,7 @@ const defaultDocstringComponents: DocstringParts = { returns: { type: "" }, yields: { type: "" }, exceptions: [], + assertions: [], }; const noTypesTemplate = `{{#args}}{{var}} {{type}}{{/args}} diff --git a/src/test/docstring/get_template.spec.ts b/src/test/docstring/get_template.spec.ts index 6101d41..a6af6b3 100644 --- a/src/test/docstring/get_template.spec.ts +++ b/src/test/docstring/get_template.spec.ts @@ -25,6 +25,14 @@ describe("getTemplate()", () => { }); }); + context("when asked for google-assert template", () => { + it("should return the string containing the google-assert mustache template", () => { + const result = getTemplate("google-assert"); + + expect(result).to.contain("Google Docstring Template with Asserts"); + }); + }); + context("when asked for sphinx template", () => { it("should return the string containing the sphinx mustache template", () => { const result = getTemplate("sphinx"); diff --git a/src/test/integration/integration.test.ts b/src/test/integration/integration.test.ts index 84d7225..69facaa 100644 --- a/src/test/integration/integration.test.ts +++ b/src/test/integration/integration.test.ts @@ -9,8 +9,8 @@ chai.config.truncateThreshold = 0; const expect = chai.expect; /** Extension identifier. */ -const identifier = "njpwerner.autodocstring"; -const settingsIdentifier = "autoDocstring"; +const identifier = "sunipkm.autodocstringpy"; +const settingsIdentifier = "autoDocstringPy"; describe("Basic Integration Tests", function () { this.timeout(30000); @@ -95,7 +95,7 @@ describe("Basic Integration Tests", function () { before(async function () { const settings = vsc.workspace.getConfiguration(settingsIdentifier); await Promise.all([ - settings.update("docstringFormat", "sphinx", true), + settings.update("docstringFormat", "sphinx-assert", true), settings.update("includeExtendedSummary", false, true), settings.update("guessTypes", true, true), settings.update("quoteStyle", '"""', true), @@ -181,6 +181,17 @@ describe("Basic Integration Tests", function () { }); }); + it("generates a docstring for the function in file 8", async function () { + await testDocstringGeneration({ + expectedOutputFilePath: path.resolve( + __dirname, + "./python_test_files/file_8_output.py", + ), + inputFilePath: path.resolve(__dirname, "./python_test_files/file_8.py"), + position: new vsc.Position(2, 0), + }); + }); + it("generates a docstring for the starlark function", async function () { await testDocstringGeneration({ expectedOutputFilePath: path.resolve( diff --git a/src/test/integration/python_test_files/file_8.py b/src/test/integration/python_test_files/file_8.py new file mode 100644 index 0000000..c848481 --- /dev/null +++ b/src/test/integration/python_test_files/file_8.py @@ -0,0 +1,10 @@ + +def function(arg1, arg2, kwarg1=1): + + assert arg1 <= 1 + assert (arg2 <= 1 and arg2 >= 0) + if arg2 > 1: + raise FileExistsError() + + yield 1 + return arg1 diff --git a/src/test/integration/python_test_files/file_8_output.py b/src/test/integration/python_test_files/file_8_output.py new file mode 100644 index 0000000..6572567 --- /dev/null +++ b/src/test/integration/python_test_files/file_8_output.py @@ -0,0 +1,25 @@ + +def function(arg1, arg2, kwarg1=1): + """_summary_ + + :param arg1: _description_ + :type arg1: _type_ + :param arg2: _description_ + :type arg2: _type_ + :param kwarg1: _description_, defaults to 1 + :type kwarg1: int, optional + :raises FileExistsError: _description_ + :asserts arg1 <= 1 + :asserts (arg2 <= 1 and arg2 >= 0) + :return: _description_ + :rtype: _type_ + :yield: _description_ + :rtype: _type_ + """ + assert arg1 <= 1 + assert (arg2 <= 1 and arg2 >= 0) + if arg2 > 1: + raise FileExistsError() + + yield 1 + return arg1 diff --git a/src/test/parse/parse_parameters.spec.ts b/src/test/parse/parse_parameters.spec.ts index 67b8248..ba5c3f5 100644 --- a/src/test/parse/parse_parameters.spec.ts +++ b/src/test/parse/parse_parameters.spec.ts @@ -18,7 +18,7 @@ describe("parseParameters()", () => { "-> int", ]; - const body = [" raise Exception", "raise Exception2"]; + const body = [" raise Exception", "raise Exception2", "assert(True)"]; const functionName = "function"; @@ -38,6 +38,7 @@ describe("parseParameters()", () => { returns: { type: "int" }, yields: undefined, exceptions: [{ type: "Exception" }, { type: "Exception2" }], + assertions: [{ type: "True" }], }); });