Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pytests #3

Merged
merged 10 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This Pylint rcfile contains a best-effort configuration to uphold the
# best-practices and style described in the Google Python style guide.
# some sections that should not be used, and some where the defautl value is ok, have been removed
# some sections that should not be used, and some where the default value is ok, have been removed
# For detailed documentation of all options see: https://pylint.pycqa.org/en/latest/user_guide/configuration/all-options.html
#
# The original file can be found here:
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"python.analysis.typeCheckingMode": "standard"
}
12 changes: 6 additions & 6 deletions coding-guidelines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Coding Style

For code formating, and naming conventions [PEP8](https://www.python.org/dev/peps/pep-0008/) is applicable.
For code formatting, and naming conventions [PEP8](https://www.python.org/dev/peps/pep-0008/) is applicable.

The following rule is defined as deviating:

Expand All @@ -14,11 +14,11 @@ The following rule is defined as deviating:

For static code analysis and to check the code style, [pylint](https://pypi.org/project/pylint/) shall be used.

Ohther common tools that can be used optionally in addition:
Other common tools that can be used optionally in addition:

- [flake8](https://flake8.pycqa.org/en/latest/index.html) with more focus on style check and support for plugins, e.g.:
- [flake8-docstrings](https://github.com/pycqa/flake8-docstrings)
- [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) finding likly bugs and design problems
- [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) finding likely bugs and design problems
- an Overview of additional plugins can be found in [flake8 plugin list](https://github.com/DmytroLitvinov/awesome-flake8-extensions?tab=readme-ov-file#docstrings)
- [mypy](https://github.com/python/mypy) static typing check for python
- [bandits](https://bandit.readthedocs.io/en/latest/) find common security issues in python
Expand All @@ -33,7 +33,7 @@ Some examples from PEP8 for naming conventions:
- Functions: "function","example_function",...
- Variables: "variable","example_variable",...

### Auto formating
### Auto formatting

[autopep8](https://pypi.org/project/autopep8/) is used for the automatic formatting of the source code

Expand All @@ -44,7 +44,7 @@ Versions of component packages are defined in requirements.txt

## Documentation

For documentation [python docstring](https://peps.python.org/pep-0257/). There are different options for formating the docstring in detail. There the [Google styleguide](https://google.github.io/styleguide/pyguide.html) applies.
For documentation [python docstring](https://peps.python.org/pep-0257/). There are different options for formatting the docstring in detail. There the [Google style guide](https://google.github.io/styleguide/pyguide.html) applies.

Based on docstrings, Source Code documentation can be generated by sphinx.

Expand All @@ -63,7 +63,7 @@ pip install sphinx_rtd_theme
pip install sphinx-favicon
```

[ReadTheDocs](https://sphinx-rtd-theme.readthedocs.io/en/stable/) is a popular theme, used wiht spingx
[ReadTheDocs](https://sphinx-rtd-theme.readthedocs.io/en/stable/) is a popular theme, used with Sphinx

A sphinx template is already prepared in the [doc/detailed-design](./doc/detailed-design/) folder

Expand Down
2 changes: 2 additions & 0 deletions src/pyProfileMgr/cmd_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ def _update_profile(args) -> Ret.CODE:
Returns:
Ret.CODE: Status code indicating the success or failure of the profile update.
"""
ret_status = Ret.CODE.RET_OK

# Update cert
if args.cert is not None:
profile_mgr = ProfileMgr()
Expand Down
Loading