Skip to main content

Tool to generate a scan report of SLIM best practices compliance

Project description


SLIM Best Practices Leaderboard

Tool to generate a scan report of SLIM best practices compliance.

Contributor Covenant SLIM

This repository serves to create a leaderboard report that ranks and showcases how well a given set of GitHub repositories follow SLIM best practices.

Features

  • Script to query a set of GitHub repositories and create a report showcasing compliance to SLIM best practices, sorted by most to least compliant, printed to standard out.
  • Best practices scanned for include all checklist items specified in the SLIM Getting Started Checklist
  • Specification of repositories via a config file - where repositories can be listed individually or automatically scanned from a parent organization.
  • Works with GitHub.com or GitHub Enterprise repositories.
  • GraphQL and parallelized queries to GitHub for optimization
  • Logging to share the status of repository compliance as the script runs.
  • Output format modes including: tree, table, and markdown
  • Verbose mode for additional statistical details and explanations

Contents

Quick Start

Use this quick start guide to generate a fresh leaderboard report.

Setup Instructions

This script requires a configuration file to operate. This file specifies the repositories and organizations to scan.

Below is an example of a configuration file named slim-config.json:

{
  "targets": [
      {
        "type": "repository",
        "name": "https://github.com/nasa-ammos/slim"
      }
  ]
}

Additional examples can be found in the examples/ sub-folder within the source repository.

Run Instructions

Requirements:

This software requires Python 3.7 or later. Usually, you'll want to create a virtual environment in order to isolate the dependencies of SLIM Leaderboard from other Python-using applications. Install SLIM Leaderboard into that environment using pip:

pip install slim-leaderboard

This installs the latest SLIM Leaderboard and its dependencies from the Python Package Index. The new console script slim-leaderboard is now ready for use. Confirm by running either:

slim-leaderboard --version
slim-leaderboard --help

To upgrade:

pip install --upgrade slim-leaderboard

Or select a specific version, such as X.Y.Z:

pip install slim-leaderboard==X.Y.Z

You'll also need a GitHub personal access token (classic). Ensure that all permissions under the "repo" group are enabled for this token, including security_events. Set the environment variable GITHUB_TOKEN with your token.

Execution:

๐Ÿ‘‰ Note: the below example outputs will change as the tool evolves and adds more checks. This is for demonstration purposes only.

To generate a fresh leaderboard report, use the following command format:

slim-leaderboard --output_format FORMAT --unsorted --verbose --emoji CONFIG_FILE

The arguments above are as follows:

  • CONFIG_FILE: Path to the JSON configuration file.
  • (Optional) --output_format FORMAT: Replace FORMAT with TREE, TABLE, MARKDOWN, or PLAIN. Default is TREE.
  • (Optional) --unsorted: If included, the results will not be sorted.
  • (Optional) --verbose: If included, outputs verbose information, including detailed statistics and explanations for each check performed.
  • (Optional) --emoji: If included, outputs emojis for statuses rathe than pure text (e.g. โœ… โŒ โš ๏ธ etc.)

Examples:

Generate a report using default settings:

slim-leaderboard slim-config.json

tree

Generate a report in table format:

slim-leaderboard --output_format TABLE slim-config.json

table

Verbose output in tree format:

slim-leaderboard --output_format TREE --verbose slim-config.json

tree-verbose

Markdown format without sorting and with emojis:

slim-leaderboard --output_format MARKDOWN --unsorted --emoji slim-config.json 
Scanning Repositories: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 2/2 [00:02<00:00,  1.15s/repo]

# SLIM Best Practices Repository Scan Report
| Owner | Repository | License | Readme | Contributing Guide | Code of Conduct | Issue Templates | PR Templates | Changelog | Additional Documentation | Secrets Detection | Governance Model | GitHub: Vulnerability Alerts | GitHub: Code Scanning Alerts | GitHub: Secret Scanning Alerts |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| nasa-ammos | slim | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โŒ | โœ… | โœ… | โœ… | โŒ |
| NASA-AMMOS | slim-starterkit-python | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โŒ | โœ… | โŒ |

Changelog

See our root CHANGELOG.md for a history of our changes.

Frequently Asked Questions (FAQ)

None. Please post a PR for this section to ask your question and the development team will add an answer.

Contributing

Interested in contributing to our project? Please see our: CONTRIBUTING.md

Local Development

For local development of SLIM Leaderboard, clone the GitHub repository, create a virtual environment, and then install the package in editable mode into it. For example:

$ git clone --quiet https://github.com/NASA-AMMOS/slim-leaderboard.git
$ cd slim-leaderboard
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install --editable .

The slim-leaderboard console-script is now ready in editable mode; changes you make to the source files under src are immediately reflected when run.

License

See our: LICENSE

Support

Key points of contact are: @riverma

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slim_leaderboard-0.0.0.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slim_leaderboard-0.0.0-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file slim_leaderboard-0.0.0.tar.gz.

File metadata

  • Download URL: slim_leaderboard-0.0.0.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for slim_leaderboard-0.0.0.tar.gz
Algorithm Hash digest
SHA256 0100c86698a42bb7d46e30deed3336b2b7c32c6ffe26d61209619eb0457a381b
MD5 02b0d90f4e8fab54ca82b8f38f275723
BLAKE2b-256 12030fea02ee71f3415ba5a3dac73ab40672da4ba740e1481267d2332e1efaac

See more details on using hashes here.

File details

Details for the file slim_leaderboard-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for slim_leaderboard-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc01cc73c2a52bdfa9470ff35f0d7099945045189cdae63848107bbee607b18a
MD5 82cd68f5f47645c4754261a72fe0cf73
BLAKE2b-256 83c5dc8e04a1998a4692a5618aba2176f5232cc92d1358c324ed01375f19bba6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page