Metadata-Version: 2.4
Name: rsmetacheck-bot
Version: 0.6.0
Summary: Metadata quality bot for software repositories, leveraging metacheck for analysis and GitHub/GitLab APIs for issue management.
Author-email: Tom François <tom.francois@lapp.in2p3.fr>
License-Expression: MIT
Project-URL: Homepage, https://github.com/SoftwareUnderstanding/rsmetacheck-bot
Project-URL: Repository, https://github.com/SoftwareUnderstanding/rsmetacheck-bot
Project-URL: Issues, https://github.com/SoftwareUnderstanding/rsmetacheck-bot/issues
Keywords: codemeta,metadata,bot,quality software
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: <3.13,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.3.1
Requires-Dist: rsmetacheck>=0.3.6
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: requests>=2.32.5
Requires-Dist: setuptools[test]<83.0.0
Requires-Dist: pydantic>=2.13.4
Provides-Extra: dev
Requires-Dist: bandit>=1.9.3; extra == "dev"
Requires-Dist: interrogate>=1.7.0; extra == "dev"
Requires-Dist: ruff>=0.14.13; extra == "dev"
Requires-Dist: ty>=0.0.12; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: setuptools<85.0.0; extra == "test"
Requires-Dist: genbadge[coverage]>=1.0.0; extra == "test"
Provides-Extra: docs
Requires-Dist: furo>=2025.12.19; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinxcontrib-mermaid>=1.0.0; extra == "docs"
Requires-Dist: tomli>=2.0.1; python_version < "3.11" and extra == "docs"
Dynamic: license-file

# rsmetacheck-bot

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.19468976.svg)](https://doi.org/10.5281/zenodo.19468976)
[![SWH](https://archive.softwareheritage.org/badge/swh:1:dir:9f3d474c040158cc675e8db135767e0d2d3fba7b/)](https://archive.softwareheritage.org/swh:1:dir:9f3d474c040158cc675e8db135767e0d2d3fba7b;origin=https://github.com/SoftwareUnderstanding/rsmetacheck-bot;visit=swh:1:snp:03da984544982fdf5aa1f556012b917250f1e4c3;anchor=swh:1:rev:fc64150edf2e35f045cf3858d81b00ca6e7f6e68)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Version](https://img.shields.io/badge/version-0.6.0-blue.svg)](https://github.com/SoftwareUnderstanding/rsmetacheck-bot/releases)
[![Python 3.11--3.12](https://img.shields.io/badge/python-3.11--3.12-blue.svg)](https://www.python.org/downloads/)
[![CI (build)](https://github.com/SoftwareUnderstanding/rsmetacheck-bot/actions/workflows/ci.yml/badge.svg)](https://github.com/SoftwareUnderstanding/rsmetacheck-bot/actions/workflows/ci.yml)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
![coverage](coverage.svg)
![interrogate](interrogate_badge.svg)
[![rsmetacheck Validation](https://github.com/SoftwareUnderstanding/sw-metadata-bot/actions/workflows/rsmetacheck.yml/badge.svg)](https://github.com/SoftwareUnderstanding/sw-metadata-bot/actions/workflows/rsmetacheck.yml)


An automated bot that analyzes repository metadata quality and creates issues with improvement suggestions.

Part of the [CodeMetaSoft](https://w3id.org/codemetasoft) project to improve research software metadata quality.

[![Subscribe](https://img.shields.io/badge/subscribe%20to%20the%20bot-blue?style=for-the-badge)](https://github.com/SoftwareUnderstanding/rsmetacheck-bot/issues/new?template=subscribe.yml)

---

## 📋 What This Bot Does

If you received an issue from this bot, it means your repository's metadata was automatically analyzed and some improvements were detected on the main default branch.

The issue contains:

- **Pitfalls**: Critical metadata issues that should be fixed
- **Warnings**: Metadata improvements that are recommended
- **Suggestions**: Specific recommendations on how to fix each issue
- **Codemeta.json generation**: if your repo does not contain any `codemeta.json` file, the bot suggests one.  

### Example Issues You Might See

```md
### [P002](https://w3id.org/rsmetacheck/catalog/#P002)
**Evidence:** P002 detected: LICENSE file contains unreplaced template placeholders

**Suggestion:** Update the copyright section with accurate names, organizations, and the current year. Personalizing this section ensures clarity and legal accuracy.
```

---

## 💬 How to Respond

### If You Agree with the Suggestions

Fix the identified issues and **close the issue** with a comment explaining what you fixed. Your improvements help your software become more discoverable and citable!

### If You Disagree or Have Questions

Feel free to **comment on the issue**. We're happy to discuss the suggestions and help clarify what's needed.

### If You're Not Interested

Simply comment **"unsubscribe"** on the issue and we'll remove your repository from future analysis.

---

## 🔍 What Analysis Is Used

This bot uses [rsmetacheck](https://github.com/SoftwareUnderstanding/rsmetacheck), which analyzes:

- Software metadata completeness
- Citation and documentation quality
- Repository structure and best practices

The bot **does not**:

- Modify your code or files
- Make pull requests
- Have access to your repository secrets

---

## Install

### pip install

```bash
pip install rsmetacheck-bot
```

### uv

```bash
uv add rsmetacheck-bot
```

## 📚 Learn More

- [CodeMetaSoft Project](https://w3id.org/codemetasoft) - About the initiative
- [rsmetacheck](https://github.com/SoftwareUnderstanding/rsmetacheck) - The analysis tool
- [Citation File Format](https://citation-file-format.github.io/) - How to add CITATION.cff

---

## 🛠️ For Maintainers Running This Bot

See [CONTRIBUTING.md](CONTRIBUTING.md) for setup and usage instructions.

Project storage policy: the repo-centric layout and migration rules are described in [docs/output_storage.rst](docs/output_storage.rst).

The pipeline is config driven: one JSON file defines the repository list, issue message, inline opt-outs, and output layout.

Supported platforms:

- ✅ GitHub.com
- ✅ Gitlab.com

The bot is handling self-hosted gitlab platform but requires providing a token to this server (and not gitlab.com).

### Safe workflow for local validation

Use these commands when validating the bot without creating live issues:

1. Legacy snapshot conversion

```bash
uv run sw-metadata-bot convert-legacy outputs/legacy_snapshot --target-root outputs/converted
```

This converts a legacy snapshot tree into the current repo-centric layout without publishing anything.

2. Fresh dry-run analysis from scratch

```bash
uv run sw-metadata-bot run-analysis --config-file config.json --snapshot-tag 202603
```

This writes analysis outputs and run reports, but remains dry-run and does not create issues.

3. Simulated publish review

```bash
uv run sw-metadata-bot simulate-publish --analysis-root outputs/batch-a/202603
```

This replays the analysis decisions with a fake issue client so you can review the generated issue bodies and opt-out logic without spamming real repositories.

> Avoid the live `publish` command unless you explicitly want to create or update real repository issues.

---

## 📝 License

See [LICENSE](LICENSE) file.
