Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ apt_packages:
build via apt-get on a Linux system.
default: "libsndfile1,"

ruff_ignore:
type: str
help: |
Enter a comma-separated list of files, directories, or file patterns that Ruff should ignore.
default: ""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
default: ""
default: ".git,docs"


valid_python_versions:
when: false
type: yaml
Expand Down
3 changes: 3 additions & 0 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ find = {} # Scan the project directory with the default parameters
exclude = [
".git",
"docs",
{%- for key in ruff_ignore.split(',') %}
"{{ key.strip() }}",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
".git",
"docs",
{%- for key in ruff_ignore.split(',') %}
"{{ key.strip() }}",
{%- for key in ruff_ignore.split(',') %}
"{{ key.strip() }}",

why not to define all excluedes with the parameter, this would make it more flexible.
sorry, I think I did not see it ealier.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, true, thanks! I didn't notice that either

{%- endfor %}
]
line-length = 79
lint.ignore = [
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def copier_project_defaults():
"copyright_statement": "2025, The pyfar developers",
"project_short_description": "my_project_short_description",
"python_versions": "['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']",
"ruff_ignore": "examples/,",
}

@pytest.fixture(scope="session")
Expand Down
1 change: 1 addition & 0 deletions tests/test_copier.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def test_content_contributing(default_project, desired):
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'Tracker = "https://github.com/pyfar/my_project/issues"',
'"docs",\n "examples/",',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'"docs",\n "examples/",',
'".git",\n "docs/",',

])
def test_content_pyproject(default_project, desired):
content = default_project.project_dir.joinpath(
Expand Down