Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: set correct organization in CONTRIBUTING.md #458

Merged
merged 1 commit into from
Oct 28, 2024
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
4 changes: 2 additions & 2 deletions src/compwa_policy/.template/CONTRIBUTING.md.jinja
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# How to contribute?

[![Open in Visual Studio Code](https://img.shields.io/badge/vscode-open-blue?logo=visualstudiocode)](https://github.dev/ComPWA/{{ REPO_NAME }})
[![Open in Visual Studio Code](https://img.shields.io/badge/vscode-open-blue?logo=visualstudiocode)](https://github.dev/{{ ORGANIZATION }}/{{ REPO_NAME }})

> [!TIP]
> This package is part of the [ComPWA Organization](https://github.com/ComPWA). For more information about how to contribute to the packages, go to **[compwa.github.io/develop](https://compwa.github.io/develop)**!

To contribute to the project, you need to install the package in a virtual environment. This can be done best with [`uv`](https://docs.astral.sh/uv) (see installation instructions [here](https://docs.astral.sh/uv/getting-started/installation)). For this, you first need to get the source code with [Git](https://git-scm.com):

```shell
git clone https://github.com/ComPWA/{{ REPO_NAME }}
git clone https://github.com/{{ ORGANIZATION }}/{{ REPO_NAME }}
cd {{ REPO_NAME }}
```

Expand Down
1 change: 1 addition & 0 deletions src/compwa_policy/check_dev_files/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def main(argv: Sequence[str] | None = None) -> int: # noqa: PLR0915
dev_python_version,
package_manager,
precommit_config,
args.repo_organization,
repo_name,
)
do(cspell.main, precommit_config, args.no_cspell_update)
Expand Down
10 changes: 7 additions & 3 deletions src/compwa_policy/check_dev_files/uv.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def main(
dev_python_version: PythonVersion,
package_manager: PackageManagerChoice,
precommit_config: ModifiablePrecommit,
organization: str,
repo_name: str,
) -> None:
with Executor() as do:
Expand All @@ -38,7 +39,7 @@ def main(
do(_update_editor_config)
do(_update_python_version_file, dev_python_version)
do(_update_uv_lock_hook, precommit_config)
do(_update_contributing_file, repo_name)
do(_update_contributing_file, organization, repo_name)
do(_remove_pip_constraint_files)
do(
vscode.remove_settings,
Expand Down Expand Up @@ -156,7 +157,7 @@ def _update_uv_lock_hook(precommit: ModifiablePrecommit) -> None:
precommit.remove_hook("uv-lock")


def _update_contributing_file(repo_name: str) -> None:
def _update_contributing_file(organization: str, repo_name: str) -> None:
contributing_file = Path("CONTRIBUTING.md")
if not contributing_file.exists():
return
Expand All @@ -166,7 +167,10 @@ def _update_contributing_file(repo_name: str) -> None:
loader=FileSystemLoader(template_dir),
)
template = env.get_template("CONTRIBUTING.md.jinja")
context = {"REPO_NAME": repo_name}
context = {
"ORGANIZATION": organization,
"REPO_NAME": repo_name,
}
expected_content = template.render(context) + "\n"
existing_content = ""
if contributing_file.exists():
Expand Down
Loading