# Lintr

[![image](https://img.shields.io/pypi/v/lintr.svg)](https://pypi.python.org/pypi/lintr)
[![image](https://img.shields.io/pypi/l/lintr.svg)](https://pypi.python.org/pypi/lintr)
[![image](https://img.shields.io/pypi/pyversions/lintr.svg)](https://pypi.python.org/pypi/lintr)

A powerful and flexible GitHub repository settings linter.

<p align="center">
  <img src="./assets/demo.gif" style="max-width: 400px; width: 100%;" alt="Demo Animation">
</p>

## Highlights

- ✅ Enforces consistent repository configurations.
- 🔒 Monitors key repository settings against predefined rules.
- 🛡️ Helps mitigate security issues.
- ⚙️ Streamlines repository management.
- 🤖 Automates checks for repository hygiene.

## Installation

Install Lintr from PyPI.

```bash
# Using pip.
pip install lintr
```

```bash
# Using pipx.
pipx install lintr
```

```bash
# Using uv.
uv install lintr
```

After installation, run Lintr via the `lintr` command. The command line reference documentation can be viewed with `lintr help`.
You can also invoke Lintr by running the `lintr` module as a script through the Python interpreter, `python -m lintr ...`.

## Features

### Command-line Interface (CLI)

Operate Lintr effortlessly through its CLI. Whether it’s linting all your repositories, listing available rules, or initializing a 
configuration file, every task can be performed with simple commands.

### Pre-defined Rules

tba

### Rule Sets

Lintr comes with pre-built rule sets covering a wide range of repository configurations, including branch policies, permissions, 
issue settings, and more.

### Automatic Fixes

For many common issues, Lintr not only detects problems but can also automatically apply fixes. This is especially useful in large 
environments where manual interventions might be too time-consuming.

### Customizability

Every project is unique. Configure Lintr with repository-specific rules and settings as needed.

### Detailed Output and Reporting

Get clear and concise feedback about each check, including colorized status symbols and descriptive messages. This clarity helps you 
quickly identify and address any problems.


## Purpose of Lintr

Lintr was built with the aim of streamlining repository management by automatically **linting** various aspects of a repository’s 
configuration. At its core, the tool monitors key repository settings and compares them against a set of predefined rules – from branch naming conventions to GitHub permission configurations. Here’s why Lintr exists:

• **Addressing Inconsistencies:**  
Many organizations face challenges due to inconsistent repository configurations, which can lead to fragmented practices and unexpected security issues. Lintr helps mitigate these issues by ensuring that every repository adheres to the desired guidelines.

• **Automation and Efficiency:**  
Manual checks are tedious and error-prone. With Lintr, you can automate the process of verifying repository settings, which not only saves time but also reduces the risk of human error.

• **Extensibility:**  
Lintr is designed to be highly extensible. Not only does it come with a set of core rules, but it also allows you to create and register custom rules tailored to your organization’s specific needs.

• **Improved Repository Health:**  
By catching configuration deviations early, Lintr helps maintain an overall healthy repository environment. This proactive monitoring can prevent potential security oversights and streamline your development workflow.

## Who Should Use Lintr?

Lintr is aimed primarily at those who manage or contribute to multiple GitHub repositories and wish to enforce a uniform standard across them. Its flexibility and robust feature set make it ideal for:

• **Repository Maintainers:**  
Ensure that every repository under your stewardship adheres to consistent configuration standards. Lintr helps catch misconfigurations before they cause issues.

• **DevOps Engineers:**  
Integrate Lintr into your CI/CD pipelines to automate the process of repository configuration validation. This guarantees that your deployment environments meet the necessary guidelines.

• **Developers Interested in Automation:**  
If you love automation and want your development process to be as robust as possible, Lintr offers automated linting that can save countless hours and reduce manual oversight.

## Quick Demo

For a glimpse of Lintr in action, imagine running a single command that inspects all your repositories, reports discrepancies, and even fixes several common issues automatically. In one terminal session, you could see output much like the following:

  ✓ repository-name: Repository has default branch set correctly  
  ✗ repository-name: Merge commits are disabled (fix available)  
  ℹ Would apply fix – run with --fix to enable auto-fixes

Feel free to include a screenshot or animated GIF of your terminal running Lintr to give newcomers an immediate visual impression of its capabilities.

────────────────────────────

By automating repository configuration audits, Lintr helps you maintain a high standard of consistency and operational excellence across your projects. Whether you’re looking to enforce best practices, improve repository security, or simply reduce manual overhead, Lintr is designed with your needs in mind.

For more details on installation, configuration, and advanced usage, continue reading the subsequent sections in this documentation. Happy linting!