Skip to content

Commit db2e183

Browse files
committed
update config, add pre-commit config
1 parent b792772 commit db2e183

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
- name: "Install dependencies"
177177
run: "poetry install --no-interaction --no-ansi --extras ctl"
178178
- name: "Setup environment"
179-
run: "pip install invoke"
179+
run: "poetry run pip install invoke"
180180
- name: "Validate generated documentation"
181181
run: "poetry run invoke docs-validate"
182182

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.3.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: check-ast
8+
- id: check-case-conflict
9+
- id: check-merge-conflict
10+
- id: check-toml
11+
- id: check-yaml
12+
- id: end-of-file-fixer
13+
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
# Ruff version.
16+
rev: v0.11.9
17+
hooks:
18+
# Run the linter.
19+
- id: ruff
20+
args: [--fix]
21+
# Run the formatter.
22+
- id: ruff-format

docs/docusaurus.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ const config: Config = {
107107
},
108108
prism: {
109109
theme: prismThemes.oneDark,
110-
additionalLanguages: ["bash", "python", "markup-templating", "django", "json", "yaml"],
110+
additionalLanguages: ["bash", "python", "markup-templating", "django", "json", "toml", "yaml"],
111111
},
112112
} satisfies Preset.ThemeConfig,
113-
113+
114114
markdown: {
115115
format: "mdx",
116116
preprocessor: ({ filePath, fileContent }) => {

infrahub_sdk/ctl/config.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import sys
66
from pathlib import Path
7-
from typing import TYPE_CHECKING
87

98
import typer
109
from pydantic import Field, ValidationError, field_validator
@@ -15,9 +14,6 @@
1514
else:
1615
import tomli as tomllib
1716

18-
if TYPE_CHECKING:
19-
import tomllib
20-
2117
DEFAULT_CONFIG_FILE = "infrahubctl.toml"
2218
ENVVAR_CONFIG_FILE = "INFRAHUBCTL_CONFIG"
2319
INFRAHUB_REPO_CONFIG_FILE = ".infrahub.yml"

0 commit comments

Comments
 (0)