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
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: ["main", "master"]
pull_request:
branches: ["*"]
release:
types: [published]

jobs:
lint:
Expand All @@ -24,6 +26,24 @@ jobs:
- name: Ruff check
run: uv run ruff check --output-format=github

- name: Interrogate (docstring coverage)
run: uv run interrogate -v src/sw_metadata_bot/

- name: Commit interrogate badge
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
uv run interrogate -o interrogate.svg -f src/sw_metadata_bot/
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add interrogate.svg
git diff --quiet && git diff --staged --quiet || git commit -m "chore: update interrogate badge"
git push
continue-on-error: true

- name: Bandit (security linter)
run: uv run bandit -c pyproject.toml -r src/sw_metadata_bot/


test:
name: Test (pytest)
runs-on: ubuntu-latest
Expand Down Expand Up @@ -86,3 +106,43 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

publish-pypi:
name: Publish to PyPI
if: github.event_name == 'release'
needs: [lint, test]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Setup uv environment
uses: ./.github/actions/setup-uv
with:
dependency-group: dev

- name: Build package
run: uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/

# publish-zenodo:
# name: Publish to Zenodo
# if: github.event_name == 'release'
# needs: [lint, test]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4

# - name: Publish to Zenodo
# uses: leokratos/github-action-json-to-zenodo@v1.0.1
# with:
# filename: codemeta.json
# zenodo_sandbox: false
# env:
# ZENODO_DEPOSITION_ID: ${{ secrets.ZENODO_DEPOSITION_ID }}
# ZENODO_ACCESS_TOKEN: ${{ secrets.ZENODO_ACCESS_TOKEN }}
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@ repos:
rev: '1.9.3' # Update me!
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
args: ["-c", "pyproject.toml"]

- repo: https://github.com/econchick/interrogate
rev: 1.7.0 # Update me!
hooks:
- id: interrogate
name: interrogate
entry: interrogate -c pyproject.toml -v src/sw_metadata_bot/
pass_filenames: false
always_run: true
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![CI](https://github.com/codemetasoft/sw-metadata-bot/workflows/CI/badge.svg)](https://github.com/codemetasoft/sw-metadata-bot/actions)
![coverage](https://img.shields.io/badge/coverage-placeholder-blue)
[![CI](https://github.com/SoftwareUnderstanding/sw-metadata-bot/workflows/CI/badge.svg)](https://github.com/codemetasoft/sw-metadata-bot/actions)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
![coverage](coverage.svg)
![interrogate](interrogate.svg)

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

Expand All @@ -18,6 +18,7 @@ Part of the [CodeMetaSoft](https://w3id.org/codemetasoft) project to improve res
If you received an issue from this bot, it means your repository's metadata was automatically analyzed and some improvements were detected.

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
Expand Down Expand Up @@ -52,11 +53,13 @@ Simply comment **"unsubscribe"** on the issue and we'll remove your repository f
## 🔍 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
Expand All @@ -76,6 +79,7 @@ The bot **does not**:
See [QUICKSTART.md](QUICKSTART.md) for setup and usage instructions.

Supported platforms:

- ✅ GitHub.com
- ✅ GitLab.com
- ✅ Self-hosted GitLab instances
Expand Down
47 changes: 47 additions & 0 deletions codemeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"@context": "https://w3id.org/codemeta/3.0",
"applicationCategory": "SoftwareSourceCode",
"author": [
{
"@id": "https://github.com/SoftwareUnderstanding",
"@type": "Organization"
},
{
"affiliation": {
"name": "Univ. Savoie Mont-Blanc, CNRS, LAPP",
"@type": "Organization"
},
"email": "tom.francois@lapp.in2p3.fr",
"@id": "https://orcid.org/0000-0001-5226-3089",
"@type": "Person"
}
],
"codeRepository": "https://github.com/SoftwareUnderstanding/sw-metadata-bot",
"dateCreated": "2025-12-15",
"dateModified": "2026-01-21",
"datePublished": "2026-01-16",
"description": "A repository to keep the code of the RSMetaCheck bot for pushing issues with existing repository metadata",
"downloadUrl": "https://github.com/SoftwareUnderstanding/sw-metadata-bot/releases",
"keywords": [
"codemeta",
"bot",
"software",
"metadata"
],
"license": "https://spdx.org/licenses/MIT",
"name": "sw-metadata-bot",
"programmingLanguage": "Python 3",
"releaseNotes": "## What's Changed\n* Fix beta test feedbacks by @francoto in https://github.com/SoftwareUnderstanding/sw-metadata-bot/pull/7\n\n\n**Full Changelog**: https://github.com/SoftwareUnderstanding/sw-metadata-bot/compare/v0.1.0...v0.1.1",
"softwareRequirements": [
"metacheck>=0.2.0",
"requests>=2.32.5"
],
"version": "v0.1.1",
"codemeta:contIntegration": {
"@id": "https://raw.githubusercontent.com/SoftwareUnderstanding/sw-metadata-bot/main/.github/workflows/ci.yml"
},
"continuousIntegration": "https://raw.githubusercontent.com/SoftwareUnderstanding/sw-metadata-bot/main/.github/workflows/ci.yml",
"developmentStatus": "active",
"issueTracker": "https://github.com/SoftwareUnderstanding/sw-metadata-bot/issues",
"@type": "SoftwareSourceCode"
}
52 changes: 52 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
API Reference
=============

This section documents all modules and functions in the sw-metadata-bot package.

Main Module
-----------

.. automodule:: sw_metadata_bot.main
:members:
:undoc-members:
:show-inheritance:

Pitfalls Module
---------------

.. automodule:: sw_metadata_bot.pitfalls
:members:
:undoc-members:
:show-inheritance:

GitHub API Module
-----------------

.. automodule:: sw_metadata_bot.github_api
:members:
:undoc-members:
:show-inheritance:

GitLab API Module
-----------------

.. automodule:: sw_metadata_bot.gitlab_api
:members:
:undoc-members:
:show-inheritance:

Create Issues Module
--------------------

.. automodule:: sw_metadata_bot.create_issues
:members:
:undoc-members:
:show-inheritance:

MetaCheck Wrapper Module
------------------------

.. automodule:: sw_metadata_bot.metacheck_wrapper
:members:
:undoc-members:
:show-inheritance:
43 changes: 38 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,52 @@
import os
import sys

project = "sw-metadata-bot"
author = "Tom François"

# Ensure src is on the path for autodoc
sys.path.insert(0, os.path.abspath("../src"))

# Project information
project = "sw-metadata-bot"
author = "Tom François"
copyright = "2026, Tom François"
release = "0.1.1"
version = "0.1"

# Extensions
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
]

# Autodoc settings
autodoc_default_options = {
"members": True,
"member-order": "bysource",
"special-members": "__init__",
"undoc-members": True,
"exclude-members": "__weakref__",
}
autodoc_typehints = "description"

# Napoleon settings for Google/NumPy style docstrings
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = True

# Intersphinx mapping
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"requests": ("https://requests.readthedocs.io/en/latest/", None),
}

templates_path = ["_templates"]
exclude_patterns = []
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# HTML output
html_theme = "furo"
html_static_path = ["_static"]
html_static_path = []
html_title = f"{project} {release}"
html_theme_options = {
"sidebar_hide_name": False,
}
33 changes: 27 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
Welcome to sw-metadata-bot's documentation
==========================================

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

Part of the `CodeMetaSoft <https://w3id.org/codemetasoft>`_ project.

.. toctree::
:maxdepth: 2
:caption: Contents:

installation
usage
api

Quick Start
-----------

Install the package:

.. code-block:: bash

pip install sw-metadata-bot

Run analysis:

.. code-block:: bash

sw-metadata-bot metacheck --repository-url https://github.com/example/repo

API Reference
-------------
Indices and tables
==================

.. automodule:: sw_metadata_bot.main
:members:
:undoc-members:
:show-inheritance:
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
32 changes: 32 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Installation
============

Requirements
------------

- Python 3.11 or 3.12
- uv (recommended) or pip

Using uv (recommended)
----------------------

.. code-block:: bash

uv pip install sw-metadata-bot

Using pip
---------

.. code-block:: bash

pip install sw-metadata-bot

From source
-----------

.. code-block:: bash

git clone https://github.com/SoftwareUnderstanding/sw-metadata-bot.git
cd sw-metadata-bot
uv sync
uv run sw-metadata-bot --help
Loading