Skip to content

Commit 472dcef

Browse files
committed
packaging: setup tooling framework
Add support for linting tools and dependencies management. The file needed are: - pyproject.toml. This is used for managing dependencies and configuration into a single file. At the moment, it is not written to be able to install this project as a proper package, but it can be changed in the future. - .pre-commit-config.yaml. This will run Ruff's linter and formatter via pre-commit. At the moment, all *py are excluded from pre-commit formatting. Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
1 parent f7dac5f commit 472dcef

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.14.0
5+
hooks:
6+
# Run the linter.
7+
- id: ruff-check
8+
args: [ --fix ]
9+
# Run the formatter.
10+
- id: ruff-format
11+
12+
exclude: |
13+
(?x)^(
14+
ciq-cherry-pick.py |
15+
check_kernel_commits.py |
16+
ciq_helpers.py |
17+
jira_pr_check.py |
18+
release_config.py |
19+
rolling-release-update.py |
20+
run_interdiff.py |
21+
)$

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This is not an installable project at the moment.
2+
# This is used to control dependencies and liter configuration
3+
[project]
4+
name = "kernel-src-tree-tools"
5+
requires-python = ">=3.10"
6+
readme = "README.md"
7+
version = "0.0.1"
8+
dependencies = [
9+
]
10+
11+
[project.optional-dependencies]
12+
dev = [
13+
"pre-commit",
14+
"ruff",
15+
]
16+
17+
[tool.ruff]
18+
line-length = 120
19+
20+
[tool.ruff.lint]
21+
# Add the `line-too-long` rule to the enforced rule set.
22+
extend-select = ["E501"]
23+
24+
[tool.setuptools]
25+
# suppress error: Multiple top-level packages
26+
py-modules = []

0 commit comments

Comments
 (0)