Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Conversation

lars-reimann
Copy link
Member

@lars-reimann lars-reimann commented Jul 5, 2022

Closes #904.

Summary of Changes

The @value annotation now has a fourth variant "omitted". It can only be used on optional parameters. This variant omits the parameter from the parameter list of the wrapper function and the call to the original function. The parameter of the original function is, therefore, always set to the original default value.

Compared to the "constant" variant this one does not have the issue that only literals can be used as values, since we never need to import anything in the wrapper files.

Screenshots (if necessary)

image

@github-actions
Copy link

github-actions bot commented Jul 5, 2022

MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ CREDENTIALS secretlint yes no 3.66s
✅ GIT git_diff yes no 0.01s
✅ JSON eslint-plugin-jsonc 4 0 0 3.45s
✅ JSON jsonlint 4 0 1.53s
✅ JSON prettier 4 0 0 2.97s
✅ JSON v8r 4 0 2.96s
✅ KOTLIN ktlint 3 0 0 8.33s
✅ PYTHON bandit 4 0 0.32s
✅ PYTHON black 4 0 0 0.58s
✅ PYTHON flake8 4 0 0.45s
✅ PYTHON isort 4 0 0 0.14s
✅ PYTHON mypy 4 0 8.28s
✅ PYTHON pylint 4 0 1.78s
✅ TSX eslint 5 0 0 11.71s
✅ TYPESCRIPT eslint 3 0 0 8.99s
✅ TYPESCRIPT prettier 8 0 0 2.0s

See errors details in artifact MegaLinter reports on CI Job page
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

@lars-reimann lars-reimann merged commit aa9aa50 into main Jul 5, 2022
@lars-reimann lars-reimann deleted the 904-for-optional-parameters-allow-using-the-default-value-as-constant-value branch July 5, 2022 10:47
@github-actions
Copy link

github-actions bot commented Jul 5, 2022

🎉 This PR is included in version 1.44.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Included in a release label Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

For optional parameters allow using the default value as constant value

1 participant