Skip to content

Commit 3b0da4e

Browse files
committed
feat: Initial commit
Signed-off-by: Lasota, Adrian <adrian.lasota@intel.com>
1 parent 9ea033b commit 3b0da4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3236
-1
lines changed

.gitignore

Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/pycharm+all,python
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=pycharm+all,python
4+
5+
### PyCharm+all ###
6+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
7+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
8+
9+
# User-specific stuff
10+
.idea/**/workspace.xml
11+
.idea/**/tasks.xml
12+
.idea/**/usage.statistics.xml
13+
.idea/**/dictionaries
14+
.idea/**/shelf
15+
16+
# Generated files
17+
.idea/**/contentModel.xml
18+
19+
# Sensitive or high-churn files
20+
.idea/**/dataSources/
21+
.idea/**/dataSources.ids
22+
.idea/**/dataSources.local.xml
23+
.idea/**/sqlDataSources.xml
24+
.idea/**/dynamic.xml
25+
.idea/**/uiDesigner.xml
26+
.idea/**/dbnavigator.xml
27+
28+
# Gradle
29+
.idea/**/gradle.xml
30+
.idea/**/libraries
31+
32+
# Gradle and Maven with auto-import
33+
# When using Gradle or Maven with auto-import, you should exclude module files,
34+
# since they will be recreated, and may cause churn. Uncomment if using
35+
# auto-import.
36+
# .idea/artifacts
37+
# .idea/compiler.xml
38+
# .idea/jarRepositories.xml
39+
# .idea/modules.xml
40+
# .idea/*.iml
41+
# .idea/modules
42+
# *.iml
43+
# *.ipr
44+
45+
# CMake
46+
cmake-build-*/
47+
48+
# Mongo Explorer plugin
49+
.idea/**/mongoSettings.xml
50+
51+
# File-based project format
52+
*.iws
53+
54+
# IntelliJ
55+
out/
56+
57+
# mpeltonen/sbt-idea plugin
58+
.idea_modules/
59+
60+
# JIRA plugin
61+
atlassian-ide-plugin.xml
62+
63+
# Cursive Clojure plugin
64+
.idea/replstate.xml
65+
66+
# Crashlytics plugin (for Android Studio and IntelliJ)
67+
com_crashlytics_export_strings.xml
68+
crashlytics.properties
69+
crashlytics-build.properties
70+
fabric.properties
71+
72+
# Editor-based Rest Client
73+
.idea/httpRequests
74+
75+
# Android studio 3.1+ serialized cache file
76+
.idea/caches/build_file_checksums.ser
77+
78+
### PyCharm+all Patch ###
79+
# Ignores the whole .idea folder and all .iml files
80+
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
81+
82+
.idea/
83+
84+
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
85+
86+
*.iml
87+
modules.xml
88+
.idea/misc.xml
89+
*.ipr
90+
91+
# Sonarlint plugin
92+
.idea/sonarlint
93+
94+
### Python ###
95+
# Byte-compiled / optimized / DLL files
96+
__pycache__/
97+
*.py[cod]
98+
*$py.class
99+
100+
# C extensions
101+
*.so
102+
103+
# Distribution / packaging
104+
.Python
105+
build/
106+
develop-eggs/
107+
dist/
108+
downloads/
109+
eggs/
110+
.eggs/
111+
lib/
112+
lib64/
113+
parts/
114+
sdist/
115+
var/
116+
wheels/
117+
pip-wheel-metadata/
118+
share/python-wheels/
119+
*.egg-info/
120+
.installed.cfg
121+
*.egg
122+
MANIFEST
123+
124+
# PyInstaller
125+
# Usually these files are written by a python script from a template
126+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
127+
*.manifest
128+
*.spec
129+
130+
# Installer logs
131+
pip-log.txt
132+
pip-delete-this-directory.txt
133+
134+
# Unit test / coverage reports
135+
htmlcov/
136+
.tox/
137+
.nox/
138+
.coverage
139+
.coverage.*
140+
.cache
141+
nosetests.xml
142+
coverage.xml
143+
coverage.json
144+
*.cover
145+
*.py,cover
146+
.hypothesis/
147+
.pytest_cache/
148+
pytestdebug.log
149+
150+
# Translations
151+
*.mo
152+
*.pot
153+
154+
# Django stuff:
155+
*.log
156+
local_settings.py
157+
db.sqlite3
158+
db.sqlite3-journal
159+
160+
# Flask stuff:
161+
instance/
162+
.webassets-cache
163+
164+
# Scrapy stuff:
165+
.scrapy
166+
167+
# Sphinx documentation
168+
docs/_build/
169+
doc/_build/
170+
171+
# PyBuilder
172+
target/
173+
174+
# Jupyter Notebook
175+
.ipynb_checkpoints
176+
177+
# IPython
178+
profile_default/
179+
ipython_config.py
180+
181+
# pyenv
182+
.python-version
183+
184+
# pipenv
185+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
186+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
187+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
188+
# install all needed dependencies.
189+
#Pipfile.lock
190+
191+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
192+
__pypackages__/
193+
194+
# Celery stuff
195+
celerybeat-schedule
196+
celerybeat.pid
197+
198+
# SageMath parsed files
199+
*.sage.py
200+
201+
# Environments
202+
.env
203+
.venv
204+
env/
205+
venv/
206+
ENV/
207+
env.bak/
208+
venv.bak/
209+
pythonenv*
210+
211+
# Spyder project settings
212+
.spyderproject
213+
.spyproject
214+
215+
# Rope project settings
216+
.ropeproject
217+
218+
# mkdocs documentation
219+
/site
220+
221+
# mypy
222+
.mypy_cache/
223+
.dmypy.json
224+
dmypy.json
225+
226+
# Pyre type checker
227+
.pyre/
228+
229+
# pytype static type analyzer
230+
.pytype/
231+
232+
# profiling data
233+
.prof
234+
235+
# End of https://www.toptal.com/developers/gitignore/api/pycharm+all,python
236+
ruff.toml
237+
.pre-commit-config.yaml

AUTHORS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# AUTHORS
2+
3+
* Arkadiusz Baczek (arkadiusz.baczek@intel.com)
4+
* Mateusz Chrominski (mateusz.chrominski@intel.com)
5+
* Hubert Cymerys (hubert.cymerys@intel.com)
6+
* Adrian Lasota (adrian.lasota@intel.com)
7+
* Agnieszka Flizikowska (agnieszka.flizikowska@intel.com)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### License
44

5-
<PROJECT NAME> is licensed under the terms in [LICENSE]<link to license file in repo>. By contributing to the project, you agree to the license and copyright terms therein and release your contribution under these terms.
5+
MFD Code Quality is licensed under the terms in [LICENSE](LICENSE.md). By contributing to the project, you agree to the license and copyright terms therein and release your contribution under these terms.
66

77
### Sign your work
88

LICENSE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The MIT License (MIT)
2+
Copyright © 2025 Intel Corporation
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
8+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
> [!IMPORTANT]
2+
> This project is under development. All source code and features on the main branch are for the purpose of testing or evaluation and not production ready.
3+
4+
# MFD Code Quality
5+
6+
## Usage
7+
8+
This module provides set of code quality related methods with corresponding command line commands.
9+
10+
### Available commands
11+
12+
When installing `mfd-code-quality` package all these commands will become available from command line - in the same way as `pip` for example.\
13+
So you can just type `mfd-help` in your terminal without a need to call it from Python.
14+
15+
16+
> `mfd-configure-code-standard`\
17+
> Prepare code standard configuration files into repository and setup pre commit.
18+
19+
> `mfd-create-config-files`\
20+
> Prepare code standard configuration files into repository without setup of pre commit.\
21+
> Mechanism of creating configs is the same as in 'mfd-configure-code-standard'.
22+
23+
> `mfd-code-standard`\
24+
Run code standard test using ruff (format, check) or flake8. Depending on what is available. It copies configuration files before code standard check and remove their after check.
25+
> It's not required to call `mfd-configure-code-standard` or `mfd-create-config-files` before running this command.
26+
27+
> `mfd-import-testing`\
28+
Run import testing of each Python file to check import problems.
29+
30+
> `mfd-system-tests`\
31+
Run system tests.
32+
33+
> `mfd-unit-tests`\
34+
Run unittests, print actual coverage, but don't check its value.
35+
36+
> `mfd-unit-tests-with-coverage`\
37+
Run unittests and check if diff coverage (new code coverage) is reaching the threshold.
38+
39+
> `mfd-all-checks`\
40+
Run all available checks.
41+
42+
> `mfd-help`\
43+
Log available commands.
44+
45+
> `mfd-format-code`\
46+
Format code using ruff check --fix and ruff format
47+
48+
All commands can be combined with `--project-dir` parameter, which should point to the root directory of your repository.
49+
If this parameter is not given current working directory will be assumed to be root directory.
50+
51+
### Configuration files
52+
We are using 3 configuration files:
53+
- `ruff.toml` - for ruff configuration
54+
- `pyproject.toml` - for project/generic configuration
55+
- `.pre-commit-config.yaml` - for pre-commit configuration
56+
57+
### Custom configuration
58+
Some modules have custom configuration files. Files are stored in `mfd_code_quality/code_standard/config_per_module` directory. Configuration files are merged with generic one during configuration process.
59+
60+
## OS supported:
61+
62+
OS agnostic
63+
64+
## Issue reporting
65+
66+
If you encounter any bugs or have suggestions for improvements, you're welcome to contribute directly or open an issue [here](https://github.com/intel/mfd-code-quality/issues).

examples/simple_example.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright (C) 2025 Intel Corporation
2+
# SPDX-License-Identifier: MIT
3+
"""Simple example of usage."""

mfd_code_quality/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright (C) 2025 Intel Corporation
2+
# SPDX-License-Identifier: MIT
3+
"""Module for MFD Code Quality."""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (C) 2025 Intel Corporation
2+
# SPDX-License-Identifier: MIT
3+
repos:
4+
- repo: local
5+
hooks:
6+
- id: code-format
7+
name: code-format
8+
entry: mfd-format-code
9+
language: python
10+
types: [ python ]
11+
pass_filenames: false
12+
verbose: true
13+
additional_dependencies: [ mfd-code-quality=={{version}} ]
14+
- id: code-standard
15+
name: code-standard
16+
entry: mfd-code-standard
17+
language: python
18+
types: [ python ]
19+
pass_filenames: false
20+
verbose: true
21+
additional_dependencies: [ mfd-code-quality=={{version}} ]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright (C) 2025 Intel Corporation
2+
# SPDX-License-Identifier: MIT
3+
"""Code standards package."""

0 commit comments

Comments
 (0)