Skip to content
Snippets Groups Projects
Verified Commit 22217a92 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

ci: add miss_hit checks to CI

parent 4faf74fa
No related branches found
No related tags found
No related merge requests found
Pipeline #5937 passed
---
# Using the official Python Docker image as default
image: python
# Columns of the pipeline
stages:
- static analysis
# Static code analysis job via MISS_HIT
static analysis:
stage: static analysis
before_script:
- pip install miss_hit
script:
- mh_style . --fix
- mh_metric . --ci
- mh_lint .
allow_failure: false
---
repos:
- repo: local
hooks:
- id: mh_style
entry: mh_style
name: mh_style
args: [--process-slx, --fix]
files: ^(.*\.(m|slx))$
language: python
additional_dependencies: [miss_hit_core]
- id: mh_metric
name: mh_metric
entry: mh_metric
args: [--ci]
files: ^(.*\.(m|slx))$
language: python
additional_dependencies: [miss_hit_core]
- id: mh_lint
name: mh_lint
entry: mh_lint
files: ^(.*\.(m|slx))$
language: python
additional_dependencies: [miss_hit]
...@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Start using MISS_HIT for style and code analysis. - Start using MISS_HIT for style and code analysis.
- ci: Add MISS_HIT job in pipeline
- ci: Add pre-commit hook for miss_hit
### Changed ### Changed
......
...@@ -140,6 +140,22 @@ errors. ...@@ -140,6 +140,22 @@ errors.
mh_lint . mh_lint .
``` ```
A more convenient way to use MISS_HIT is to include it in a pre-commit hook.
This can be done with [pre-commit][pre-commit-site]. To install both
dependencies just run:
```bash
pip3 install -r requirements.txt
```
The install the pre-commit hooks using:
```bash
pre-commit install
```
Now the three MISS_HIT checks will be run every time you make a commit.
#### Other #### Other
Some other conventions can not be currently enforced by MISS_HIT. They should Some other conventions can not be currently enforced by MISS_HIT. They should
...@@ -172,5 +188,6 @@ The following naming convention is adopted: ...@@ -172,5 +188,6 @@ The following naming convention is adopted:
5. Ensure MISS_HIT is happy 5. Ensure MISS_HIT is happy
6. Submit your Merge Request. 6. Submit your Merge Request.
[pre-commit-site]: https://pre-commit.com/
[miss_hit]: https://github.com/florianschanda/miss_hit [miss_hit]: https://github.com/florianschanda/miss_hit
[miss_hit_cfg]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/blob/master/miss_hit.cfgj:w [miss_hit_cfg]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/blob/master/miss_hit.cfgj:w
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment