Skip to content

LintBot: A GitHub App that automatically checks JavaScript files in pull requests for code quality issues using ESLint. It provides detailed feedback directly in pull request comments, helping developers maintain high code standards effortlessly.

License

Notifications You must be signed in to change notification settings

AnasJahangir/LintBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LintBot Documentation

Overview

LintBot is a GitHub App designed to automatically check JavaScript files in pull requests for code quality issues using ESLint. Whenever a pull request is opened, LintBot retrieves the JavaScript files, runs ESLint checks, and comments on the pull request with any issues found.

Features

  • Automatic ESLint Checks: On every pull request, LintBot checks for JavaScript code quality.
  • Detailed Feedback: Provides feedback directly in the pull request comments, highlighting any errors or warnings.

Technologies Used

  • Backend: Node.js, Express
  • GitHub API: Octokit
  • Linting: ESLint
  • Environment Variables: dotenv for managing sensitive information

Getting Started

Prerequisites

  • Node.js (version 14 or higher)
  • GitHub account and a GitHub App setup
  • MongoDB (if you choose to store any data)

Installation

  1. Clone the repository:
    git clone https://github.com/AnasJahangir/lintbot.git
    cd lintbot
  2. Install dependencies:
    npm install
  3. Create a .env file in the root of the project and add your GitHub App credentials:
    GITHUB_APP_ID=your_app_id
    GITHUB_PRIVATE_KEY=your_private_key
    PORT=3000

Running the Application

Start the server:

npm start

The server will be listening on the port defined in your environment variables (default is 3000).

How to Set Up GitHub App

  1. Go to your GitHub account settings and navigate to "Developer settings."
  2. Click on "GitHub Apps" and then "New GitHub App."
  3. Fill in the required fields:
  4. Set the necessary permissions:
    • Repository Permissions: Read and write access for issues and pull requests.
  5. Generate a private key and add it to your .env file as GITHUB_PRIVATE_KEY.

API Endpoints

Webhook

POST /webhook - This endpoint listens for GitHub webhook events. When a pull request is opened, it triggers the ESLint checks on JavaScript files.

Folder Structure

lintbot/
├── node_modules/
├── .env
├── package.json
├── index.js
└── README.md

Contributing

If you would like to contribute to LintBot, please fork the repository and submit a pull request.

License

This project is licensed under the MIT License.

How to Use the Documentation

  • Copy the markdown text above and paste it into a README.md file in your project repository.
  • Customize any sections as needed to match your specific implementation or additional features.

Feel free to modify the name and features as per your application’s specifics or any additional functionality you may have!

About

LintBot: A GitHub App that automatically checks JavaScript files in pull requests for code quality issues using ESLint. It provides detailed feedback directly in pull request comments, helping developers maintain high code standards effortlessly.

Resources

License

Stars

Watchers

Forks

Packages

No packages published