https://github.com/ultimaker/python-quality-control
https://github.com/ultimaker/python-quality-control
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ultimaker/python-quality-control
- Owner: Ultimaker
- Created: 2022-02-03T14:13:22.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-07-15T10:25:49.000Z (11 months ago)
- Last Synced: 2025-08-11T00:40:15.834Z (10 months ago)
- Language: Shell
- Size: 84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This directory contains scripts to perform different types of static code analysis:
* `reference` is a support script, gathers all changed files to be analyzed by the different scripts.
* `run_flake8` validate PEP8 standards, cyclomatic complexity and more.
* `run_mypy` check for and validate typing usage.
* `run_pycodestyle` same as flake8, does some checks not handled by flake8. Overlapping checks are disabled for pycodestyle.
* `run_pytest` executes the unit tests.
* `run_specific` drags in project specific checks into the CI/CD flow. Checks for and executes all scripts in `{PRJ_ROOT}/ci_specific`
* `run_vulture` tests for dead/unused code.
The `cfg` folder contains the configuration files for the different code analysis tools.
The `local` folder contains the scripts that enable execution of the scripts in a Docker on a developers device.
This repository also implements Reusable Workflows and Actions for Github Actions.
Reusable Workflows:
- **Flake8**, **MyPy**, **PyCodeStyle**, **PyLint**: They all call the respective scripts inside a docker container and requires as `input` field the `Parent_Branch` to compare the filed against.
- **PyTest**: Fetch the companion repositories and then run the `run_pytest.sh` inside a docker container. It takes as optional `input` a `default-branch` to checkout the companion repositories in case there is no branch with the same name as the
caller branch. If not provided, it defaults to the repository default branch.
- **Vulture**: Run the `run_vulture.sh` inside a docker container. It takes no `input`.
Actions:
- **clone_repo**: Clone a specific repository and try to check out the current working branch, otherwise checkout the default one (default can be specified using an input field. If not specified, it uses the repo default one).
- **fetch_companion_repos**: Clone all “known” companion repos (currently: dbus-interface-lib, marvin-service, libPalantir, libSmeagol, libCharon, libLogger, ultiLib). This action basically calls clone_repo for all those repositories.
Excluding files:
Files can be excluded from the linting by individual repositories using a text file in the root of the repo with the name: linting_excluded_file.txt.
The format for the file expected would be:
```
cfg/flake8.ini
references.sh
```