mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
style: Format code with linter
This commit is contained in:
parent
2af6b96daa
commit
99ec8e5927
1 changed files with 22 additions and 12 deletions
|
@ -1,6 +1,9 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from aider.special import is_important, filter_important_files
|
|
||||||
|
from aider.special import filter_important_files, is_important
|
||||||
|
|
||||||
|
|
||||||
def test_is_important():
|
def test_is_important():
|
||||||
# Test common important files
|
# Test common important files
|
||||||
|
@ -18,6 +21,7 @@ def test_is_important():
|
||||||
assert not is_important("src/main.py")
|
assert not is_important("src/main.py")
|
||||||
assert not is_important("tests/test_app.py")
|
assert not is_important("tests/test_app.py")
|
||||||
|
|
||||||
|
|
||||||
def test_filter_important_files():
|
def test_filter_important_files():
|
||||||
files = [
|
files = [
|
||||||
"README.md",
|
"README.md",
|
||||||
|
@ -38,6 +42,7 @@ def test_filter_important_files():
|
||||||
".github/workflows/test.yml",
|
".github/workflows/test.yml",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def test_is_important_case_sensitivity():
|
def test_is_important_case_sensitivity():
|
||||||
# Test case sensitivity
|
# Test case sensitivity
|
||||||
assert is_important("README.md")
|
assert is_important("README.md")
|
||||||
|
@ -45,22 +50,27 @@ def test_is_important_case_sensitivity():
|
||||||
assert is_important(".gitignore")
|
assert is_important(".gitignore")
|
||||||
assert not is_important(".GITIGNORE")
|
assert not is_important(".GITIGNORE")
|
||||||
|
|
||||||
|
|
||||||
def test_is_important_with_paths():
|
def test_is_important_with_paths():
|
||||||
# Test with different path formats
|
# Test with different path formats
|
||||||
assert is_important("project/README.md")
|
assert is_important("project/README.md")
|
||||||
assert is_important("./README.md")
|
assert is_important("./README.md")
|
||||||
assert is_important("/absolute/path/to/README.md")
|
assert is_important("/absolute/path/to/README.md")
|
||||||
|
|
||||||
@pytest.mark.parametrize("file_path", [
|
|
||||||
"README",
|
@pytest.mark.parametrize(
|
||||||
"README.txt",
|
"file_path",
|
||||||
"README.rst",
|
[
|
||||||
"LICENSE",
|
"README",
|
||||||
"LICENSE.md",
|
"README.txt",
|
||||||
"LICENSE.txt",
|
"README.rst",
|
||||||
"Dockerfile",
|
"LICENSE",
|
||||||
"package.json",
|
"LICENSE.md",
|
||||||
"pyproject.toml",
|
"LICENSE.txt",
|
||||||
])
|
"Dockerfile",
|
||||||
|
"package.json",
|
||||||
|
"pyproject.toml",
|
||||||
|
],
|
||||||
|
)
|
||||||
def test_is_important_various_files(file_path):
|
def test_is_important_various_files(file_path):
|
||||||
assert is_important(file_path)
|
assert is_important(file_path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue