Skip to main content

RepoAuditor - README

Project: License

Package: PyPI - Python Version PyPI - Version PyPI - Downloads

Development: uv CI Code Coverage GitHub commit activity

Contents

Installation

We recommend using uv since it can install RepoAuditor as a tool via uvx into a sandbox environment for quick use. This lets you directly run RepoAuditor.

uvx RepoAuditor

Alternatively, yuou can install RepoAuditor via uv or pip. uv is preferred to pip since it creates and manages a virtual environment.

Installation Method Command
Via uv uv add repoauditor
Via pip pip install repoauditor

Overview

How to use RepoAuditor

Once installed, you can invoke the following to verify if RepoAuditor is installed correctly:

uvx RepoAuditor --version

and you should see something like

RepoAuditor vX.X.X

To get a list of command line options, you can run

uvx RepoAuditor --help

Personal Access Token (PAT)

The most common use case for RepoAuditor would be to audit a GitHub repository. In order to allow RepoAuditor to read the repository, you first need to generate a Personal Access Token or PAT.

Please refer to the GitHub documentation on Personal Access Tokens for details about a Fine-grained PAT which we will be using.

To generate the Fine-grained PAT, we perform the following steps:

  1. Go to Settings -> Developer settings -> Personal Access Token -> Fine-grained tokens.
  2. Click on Generate new token.
  3. Give the token a name and a description.
  4. Set an appropriate expiration date.
  5. Under Repository Access, select All repositories.
  6. For permissions, we need to go to Repository permissions.
  7. Enable the following permissions:
    • Read-Write access to Contents.
    • Read access to Administration and Secret scanning alerts.
  8. Click on Generate token.
  9. Copy the generated string. This is your PAT.
  10. Save the PAT to a convenient location on your machine (such as your hime directory ~/) in the file PAT.txt.

The path to the PAT.txt will be passed into RepoAuditor. E.g.

uvx RepoAuditor --GitHub-pat ~/PAT.txt

Example Usage

With the above generated PAT file, you can now run RepoAuditor on your GitHub repository.

As a general example, we will use the python-helloworld repository.

NOTE You need to fork the repository since your default PAT only has access to repos under your account.

To run RepoAuditor, we can enter the following in the command-line:

uvx RepoAuditor --include GitHub \
  --GitHub-url https://github.com/<username>/python-helloworld \
  --GitHub-pat ~/PAT.txt

RepoAuditor will generate a series of messages describing all the issues in the repository, along with the rationale behind them and the steps for resolution.

Custom Settings

RepoAuditor tries to provide default settings and checks which are considered best practices. However, your team or organization may have different ways of doing things. You can override the default settings by specifying the appropriate flag.

We have 3 types of flags:

  1. Boolean flags for those settings which are checked to be on by default and you wish to check are off, with the form Module-no-Requirement (e.g. --GitHub-no-MergeCommit).
  2. Conversely, boolean flags for those settings which are checked to be off by default, and you wish to check are on, denoted by the form Module-Requirement (e.g. --GitHub-AllowDeletions).
  3. Values flags take a string value to determine what value to enforce, and have the form Module-Requirement-value (e.g. --GitHub-License-value "MIT License").

Please run uvx repoauditor --help to get the list of all flags available.

Examples

For example, RepoAuditor by default checks that the setting Allow rebase merging is off. If you wish to check that this setting is turned on, you can run:

uvx repoauditor --GitHub-RebaseMergeCommit

Similarly, RepoAuditor checks if Issues are enabled. You can set RepoAuditor to check if Issues is disabled by specifying

uvx repoauditor --GitHub-no-SupportIssues

Finally, RepoAuditor by default enforces that the MIT License exists for the repository. If your organization requires another license (such as GPL), you can enforce that by specifying the license keyword such as:

uvx repoauditor --GitHub-License-value "GNU General Public License v2.0"

The types of licenses supported by GitHub can be found here. Be sure to specify the full license name, e.g. GNU General Public License v2.0.

Config File

RepoAuditor accepts both a set of flags as well as a configuratin YAML file.

The configuration (or config) file can make usage easier by recording preferences as well as facilitating sharing of enforced requirements within an organization. We have provided a sample configuration file called default_config.yaml, which can be used as:

uvx run RepoAuditor --config default_config.yaml

Development

Please visit Contributing and Development for information on contributing to this project.

Additional Information

Additional information can be found at these locations.

Title Document Description
Code of Conduct CODE_OF_CONDUCT.md Information about the norms, rules, and responsibilities we adhere to when participating in this open source community.
Contributing CONTRIBUTING.md Information about contributing to this project.
Development DEVELOPMENT.md Information about development activities involved in making changes to this project.
Governance GOVERNANCE.md Information about how this project is governed.
Maintainers MAINTAINERS.md Information about individuals who maintain this project.
Security SECURITY.md Information about how to privately report security issues associated with this project.

License

RepoAuditor is licensed under the MIT license.

Metadata

Release files for RepoAuditor 0.2.82

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for RepoAuditor 0.2.82
File Size Uploaded Provenance Actions
repoauditor-0.2.82.tar.gz 150.3 kB Without provenance Details for repoauditor-0.2.82.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for RepoAuditor 0.2.82
File Interpreter ABI Platform Actions
repoauditor-0.2.82-py3-none-any.whl Python 3 none any Details for repoauditor-0.2.82-py3-none-any.whl

Total release size: 259.7 kB

Release files / repoauditor-0.2.82.tar.gz

Download URL repoauditor-0.2.82.tar.gz
Size 150.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8545f9a75cccf2cba9832c70cebf92a4f421852f98b6213634ceacf0a3e13525
BLAKE2b-256 checksum
How to use checksums
6d55bac1162e0c755edff66448b2c36c804903c196527c9084105b77b85cebee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.5

Release files / repoauditor-0.2.82-py3-none-any.whl

Download URL repoauditor-0.2.82-py3-none-any.whl
Size 109.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5adb0737b61eca7eaef60d06a109ec8d2c8f488a0d051b5eaf6083639b6d6166
BLAKE2b-256 checksum
How to use checksums
bd610d78543fce462692bd93b3d3fd8227ddf6bcb9fe10d46a0837b00d5108da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.5

Security for RepoAuditor 0.2.82

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.82 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page