From 5e030a65a9df03ffbff03fa1168848bef53dbc23 Mon Sep 17 00:00:00 2001
From: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Tue, 15 Mar 2022 11:36:11 +0100
Subject: [PATCH] Replace template defauts

---
 docs/README.rst                             |  7 ++++---
 setup.py                                    | 15 ++++++---------
 swh/foo/cli.py                              | 19 -------------------
 swh/{foo => scrubber}/__init__.py           |  0
 swh/{foo => scrubber}/bar.py                |  0
 swh/scrubber/cli.py                         | 11 +++++++++++
 swh/{foo => scrubber}/py.typed              |  0
 swh/{foo => scrubber}/tests/__init__.py     |  0
 swh/{foo => scrubber}/tests/test_nothing.py |  0
 tox.ini                                     |  4 ++--
 10 files changed, 23 insertions(+), 33 deletions(-)
 delete mode 100644 swh/foo/cli.py
 rename swh/{foo => scrubber}/__init__.py (100%)
 rename swh/{foo => scrubber}/bar.py (100%)
 create mode 100644 swh/scrubber/cli.py
 rename swh/{foo => scrubber}/py.typed (100%)
 rename swh/{foo => scrubber}/tests/__init__.py (100%)
 rename swh/{foo => scrubber}/tests/test_nothing.py (100%)

diff --git a/docs/README.rst b/docs/README.rst
index 492778f..26db8e8 100644
--- a/docs/README.rst
+++ b/docs/README.rst
@@ -1,4 +1,5 @@
-Software Heritage - Python module template
-==========================================
+Software Heritage - Datastore Scrubber
+======================================
 
-Python module template, used as skeleton to create new modules.
+Tools to periodically checks data integrity in swh-storage and swh-objstorage,
+reports errors, and (try to) fix them.
diff --git a/setup.py b/setup.py
index aa521d8..be63d80 100755
--- a/setup.py
+++ b/setup.py
@@ -36,18 +36,15 @@ def parse_requirements(*names):
     return requirements
 
 
-# Edit this part to match your module, replace foo by its name
-# Full sample:
-#   https://forge.softwareheritage.org/diffusion/DCORE/browse/master/setup.py
 setup(
-    name="swh.foo",  # example: swh.loader.pypi
-    description="Software Heritage <Module's intent>",
+    name="swh.scrubber",  # example: swh.loader.pypi
+    description="Software Heritage Datastore Scrubber",
     long_description=long_description,
     long_description_content_type="text/x-rst",
     python_requires=">=3.7",
     author="Software Heritage developers",
     author_email="swh-devel@inria.fr",
-    url="https://forge.softwareheritage.org/diffusion/<module-git-code>",
+    url="https://forge.softwareheritage.org/diffusion/swh-scrubber",
     packages=find_packages(),  # packages's modules
     install_requires=parse_requirements(None, "swh"),
     tests_require=parse_requirements("test"),
@@ -57,7 +54,7 @@ setup(
     include_package_data=True,
     entry_points="""
         [swh.cli.subcommands]
-        foo=swh.foo.cli
+        scrubber=swh.scrubber.cli
     """,
     classifiers=[
         "Programming Language :: Python :: 3",
@@ -69,7 +66,7 @@ setup(
     project_urls={
         "Bug Reports": "https://forge.softwareheritage.org/maniphest",
         "Funding": "https://www.softwareheritage.org/donate",
-        "Source": "https://forge.softwareheritage.org/source/swh-<module>",
-        "Documentation": "https://docs.softwareheritage.org/devel/swh-<module>/",
+        "Source": "https://forge.softwareheritage.org/source/swh-scrubber",
+        "Documentation": "https://docs.softwareheritage.org/devel/swh-scrubber/",
     },
 )
diff --git a/swh/foo/cli.py b/swh/foo/cli.py
deleted file mode 100644
index 07c279b..0000000
--- a/swh/foo/cli.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import click
-
-from swh.core.cli import CONTEXT_SETTINGS
-from swh.core.cli import swh as swh_cli_group
-
-
-@swh_cli_group.group(name="foo", context_settings=CONTEXT_SETTINGS)
-@click.pass_context
-def foo_cli_group(ctx):
-    """Foo main command.
-    """
-
-
-@foo_cli_group.command()
-@click.option("--bar", help="Something")
-@click.pass_context
-def bar(ctx, bar):
-    """Do something."""
-    click.echo("bar")
diff --git a/swh/foo/__init__.py b/swh/scrubber/__init__.py
similarity index 100%
rename from swh/foo/__init__.py
rename to swh/scrubber/__init__.py
diff --git a/swh/foo/bar.py b/swh/scrubber/bar.py
similarity index 100%
rename from swh/foo/bar.py
rename to swh/scrubber/bar.py
diff --git a/swh/scrubber/cli.py b/swh/scrubber/cli.py
new file mode 100644
index 0000000..8bd7d7a
--- /dev/null
+++ b/swh/scrubber/cli.py
@@ -0,0 +1,11 @@
+import click
+
+from swh.core.cli import CONTEXT_SETTINGS
+from swh.core.cli import swh as swh_cli_group
+
+
+@swh_cli_group.group(name="scrubber", context_settings=CONTEXT_SETTINGS)
+@click.pass_context
+def scrubber_cli_group(ctx):
+    """main command of the datastore scrubber
+    """
diff --git a/swh/foo/py.typed b/swh/scrubber/py.typed
similarity index 100%
rename from swh/foo/py.typed
rename to swh/scrubber/py.typed
diff --git a/swh/foo/tests/__init__.py b/swh/scrubber/tests/__init__.py
similarity index 100%
rename from swh/foo/tests/__init__.py
rename to swh/scrubber/tests/__init__.py
diff --git a/swh/foo/tests/test_nothing.py b/swh/scrubber/tests/test_nothing.py
similarity index 100%
rename from swh/foo/tests/test_nothing.py
rename to swh/scrubber/tests/test_nothing.py
diff --git a/tox.ini b/tox.ini
index c27d4ab..5913c01 100644
--- a/tox.ini
+++ b/tox.ini
@@ -8,8 +8,8 @@ deps =
   pytest-cov
 commands =
   pytest --doctest-modules \
-         {envsitepackagesdir}/swh/foo \
-         --cov={envsitepackagesdir}/swh/foo \
+         {envsitepackagesdir}/swh/scrubber \
+         --cov={envsitepackagesdir}/swh/scrubber \
          --cov-branch {posargs}
 
 [testenv:black]
-- 
GitLab