Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,3 @@ jobs:
run: |
uv pip install pre-commit
uv run pre-commit run --all-files --show-diff-on-failure

- name: Run Bandit
run: |
uv pip install bandit
uv run bandit -r . -x "./.venv/*","./tests" --severity-level medium
30 changes: 23 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
repos:
- repo: https://github.com/psf/black
rev: 25.11.0
hooks:
- id: black
default_language_version:
python: python3.12

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.5
rev: v0.15.15
hooks:
- id: ruff
- id: ruff-check
args: ["--fix", "--exit-non-zero-on-fix"]
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace

Expand All @@ -21,6 +27,16 @@ repos:
hooks:
- id: pyproject-fmt

- repo: https://github.com/PyCQA/bandit
rev: 1.9.4
hooks:
- id: bandit
additional_dependencies:
- "bandit[toml]"
args:
- "--configfile=pyproject.toml"
- "--severity-level=medium"

- repo: local
hooks:
- id: Test Coverage
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ optional-dependencies.dev = [
"metis[test]",
]
optional-dependencies.lint = [
"black>=26.5.1",
"bandit>=1.9.4",
"mypy>=2.1.0",
"pre-commit>=4.6.0",
"ruff>=0.15.15",
Expand Down Expand Up @@ -73,5 +73,8 @@ package-data."metis.plugins" = [ "plugins.yaml" ]
package-data."metis.schemas" = [ "*.json" ]
package-data.metis = [ "metis.yaml" ]

[tool.ruff]
lint.isort.force-single-line = true

[tool.pyproject-fmt]
keep_full_version = true
2 changes: 1 addition & 1 deletion src/metis/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def pretty_print_reviews(results, quiet=False):
print_console(f"\n[bold blue]File: {escape(file)}[/bold blue]", quiet)
for idx, r in enumerate(reviews, 1):
print_console(
f" [yellow]Identified issue {idx}:[/yellow] [bold]{escape(r.get('issue','-'))}[/bold]",
f" [yellow]Identified issue {idx}:[/yellow] [bold]{escape(r.get('issue', '-'))}[/bold]",
quiet,
)
if r.get("code_snippet"):
Expand Down
1 change: 0 additions & 1 deletion src/metis/providers/azure_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ async def _aget_text_embeddings(self, texts: list[str]) -> list[Embedding]:


class AzureOpenAIProvider(LLMProvider):

def __init__(self, config: AzureOpenAIProviderConfig) -> None:
self.api_key = config["llm_api_key"]
self.azure_endpoint = config["azure_endpoint"]
Expand Down
1 change: 0 additions & 1 deletion src/metis/providers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class QueryEngineKwargs(ProviderChatModelKwargs, total=False):


class LLMProvider(ABC):

def __init__(self, config: ProviderRuntimeConfig) -> None:
pass

Expand Down
1 change: 0 additions & 1 deletion src/metis/providers/ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class OllamaProvider(OpenAICompatibleProvider):

def __init__(self, config):
super().__init__(config)
if not self.base_url:
Expand Down
1 change: 0 additions & 1 deletion src/metis/providers/openai_compatible.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@


class OpenAICompatibleProvider(LLMProvider):

def __init__(self, config: OpenAICompatibleProviderConfig) -> None:
self.config = config
self.api_key = config.get("llm_api_key")
Expand Down
1 change: 0 additions & 1 deletion src/metis/providers/vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class VLLMProvider(OpenAICompatibleProvider):

def __init__(self, config):
super().__init__(config)
if not self.base_url:
Expand Down
1 change: 0 additions & 1 deletion src/metis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def find_snippet_line(snippet, file_lines, threshold=0.80):
norm_snippet = normalize_lines(snippet_lines)

for i in range(len(file_lines) - snippet_len + 1):

window = file_lines[i : i + snippet_len]
norm_window = normalize_lines(window)

Expand Down