Skip to content

Commit

Permalink
add in formatting skip everything
Browse files Browse the repository at this point in the history
ghstack-source-id: 34fe56595eac4d1a2fecb07a230307c0b2b767d7
Pull Request resolved: #688
  • Loading branch information
drisspg committed Aug 15, 2024
1 parent 18e38f1 commit 55637f3
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ruff_linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Code Analysis with Ruff

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Analyzing the code with ruff
run: |
ruff check .
- name: Check well formatted code
run: |
ruff format --check
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.6
hooks:
# Run the linter.
# - id: ruff
# args: [--fix]
# Run the formatter.
- id: ruff-format
4 changes: 4 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ tabulate # QOL for printing tables to stdout

# Custom CUDA Extensions
ninja

# Linting
ruff
pre-commit
1 change: 1 addition & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exclude = ["**/*"]

0 comments on commit 55637f3

Please sign in to comment.