fix(ci): auto-run formatters
This commit is contained in:
parent
9bfd495ef0
commit
8a66b92684
3 changed files with 54 additions and 22 deletions
25
.github/workflows/quality.yml
vendored
25
.github/workflows/quality.yml
vendored
|
|
@ -12,6 +12,7 @@ jobs:
|
|||
outputs:
|
||||
lua: ${{ steps.changes.outputs.lua }}
|
||||
python: ${{ steps.changes.outputs.python }}
|
||||
markdown: ${{ steps.changes.outputs.markdown }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
|
|
@ -33,6 +34,9 @@ jobs:
|
|||
- 'tests/scrapers/**'
|
||||
- 'pyproject.toml'
|
||||
- 'uv.lock'
|
||||
markdown:
|
||||
- '*.md'
|
||||
- 'docs/**/*.md'
|
||||
|
||||
lua-format:
|
||||
name: Lua Format Check
|
||||
|
|
@ -115,3 +119,24 @@ jobs:
|
|||
run: uv sync --dev
|
||||
- name: Type check Python files with mypy
|
||||
run: uv run mypy scrapers/ tests/scrapers/
|
||||
|
||||
markdown-format:
|
||||
name: Markdown Format Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: ${{ needs.changes.outputs.markdown == 'true' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 8
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'pnpm'
|
||||
- name: Install prettier
|
||||
run: pnpm add -g prettier@3.1.0
|
||||
- name: Check markdown formatting with prettier
|
||||
run: prettier --check "*.md" "docs/**/*.md" || true
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ repos:
|
|||
hooks:
|
||||
- id: stylua-github
|
||||
name: stylua (Lua formatter)
|
||||
args: ["--check", "."]
|
||||
args: ["."]
|
||||
files: ^(lua/|spec/|plugin/|after/|ftdetect/|.*\.lua$)
|
||||
additional_dependencies: []
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
|
|
@ -16,7 +16,7 @@ repos:
|
|||
files: ^(scrapers/|tests/scrapers/|.*\.py$)
|
||||
- id: ruff
|
||||
name: ruff (lint)
|
||||
args: ["--no-fix"]
|
||||
args: ["--fix", "--select=I"]
|
||||
files: ^(scrapers/|tests/scrapers/|.*\.py$)
|
||||
- repo: local
|
||||
hooks:
|
||||
|
|
@ -27,3 +27,9 @@ repos:
|
|||
args: ["scrapers/", "tests/scrapers/"]
|
||||
files: ^(scrapers/|tests/scrapers/|.*\.py$)
|
||||
pass_filenames: false
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: v3.1.0
|
||||
hooks:
|
||||
- id: prettier
|
||||
name: prettier (format markdown)
|
||||
files: \.(md)$
|
||||
|
|
|
|||
41
README.md
41
README.md
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Scrape problems, run tests, and debug solutions across multiple platforms with zero configuration.
|
||||
|
||||
> **Disclaimer**: This plugin scrapes data from competitive programming websites. Use at your own risk.
|
||||
> **Disclaimer**: cp.nvim webs crapes data from competitive programming platforms - use at your own risk.
|
||||
|
||||
https://github.com/user-attachments/assets/cb142535-fba0-4280-8f11-66ad1ca50ca9
|
||||
|
||||
|
|
@ -24,30 +24,31 @@ https://github.com/user-attachments/assets/cb142535-fba0-4280-8f11-66ad1ca50ca9
|
|||
|
||||
## Quick Start
|
||||
|
||||
Set up a Codeforces problem with contest ID 1848:
|
||||
```
|
||||
:CP codeforces 1848 A
|
||||
```
|
||||
|
||||
Navigate between problems:
|
||||
```
|
||||
:CP next
|
||||
:CP prev
|
||||
```
|
||||
|
||||
Run tests:
|
||||
```
|
||||
:CP run
|
||||
```
|
||||
|
||||
## Workflow
|
||||
|
||||
cp.nvim follows a simple principle: **solve locally, submit remotely**.
|
||||
|
||||
### Basic Usage
|
||||
|
||||
1. **Find a problem** on the judge website
|
||||
2. **Set up locally** with `:CP <platform> <contest> <problem>`
|
||||
|
||||
```
|
||||
:CP codeforces 1848 A
|
||||
```
|
||||
|
||||
3. **Code and test** with instant feedback and rich diffs
|
||||
4. **Submit** on the original website
|
||||
|
||||
```
|
||||
:CP run
|
||||
```
|
||||
|
||||
4. **Navigate between problems**
|
||||
|
||||
```
|
||||
:CP next
|
||||
:CP prev
|
||||
```
|
||||
|
||||
5. **Submit** on the original website
|
||||
|
||||
## Documentation
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue