forked from Opensource-IIITH/Discord-CAS
-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (40 loc) · 1.14 KB
/
formatting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Auto Linitng and Formatting
on:
push:
branches:
- master
jobs:
linting_formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# JS Formatting
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Prettier
run: |
npm install --global prettier
- name: Format with Prettier
run: prettier --write "**/*.{js,jsx,md,mdx,css,yaml}"
# Python Formatting
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Lint with ruff
run: ruff check --fix bot/*.py
- name: Format with ruff
run: ruff format bot/*.py
- name: Remove ruff cache
run: rm -rf .ruff_cache
# Commit Changes
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply Linting & Formatting Fixes