Skip to content

Commit

Permalink
refactor: too lazy to split commits
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
jfcherng committed May 12, 2024
1 parent ca0ba1b commit 6776224
Show file tree
Hide file tree
Showing 18 changed files with 4,650 additions and 147 deletions.
37 changes: 37 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# EditorConfig is awesome: https://EditorConfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab

[*.md]
indent_size = 2
trim_trailing_whitespace = false

[*.json]
indent_size = 4

[*.py]
indent_size = 4

[*.toml]
indent_size = 2

[sublime-package.json]
indent_size = 2

[*.{sublime-commands,sublime-keymap,sublime-menu,sublime-mousemap,sublime-settings}]
indent_size = 4

[*.sublime-syntax]
indent_size = 2

[*.tmPreferences]
indent_size = 4
27 changes: 27 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
*.pyi export-ignore
.dependabot export-ignore
.editorconfig export-ignore
.flake8 export-ignore
.gitattributes export-ignore
.github/ export-ignore
.gitignore export-ignore
.gitmodules export-ignore
.style.yapf export-ignore
.travis.yml export-ignore
cliff.toml export-ignore
codecov.yml export-ignore
docs/ export-ignore
Makefile export-ignore
mkdocs.yml export-ignore
mypy.ini export-ignore
py.typed export-ignore
pyproject.toml export-ignore
pyrightconfig.json export-ignore
requirements-* export-ignore
requirements.* export-ignore
scripts/ export-ignore
stubs/ export-ignore
tests/ export-ignore
tox.ini export-ignore
typings/ export-ignore
unittesting.json export-ignore
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://www.paypal.me/jfcherng/5usd
54 changes: 54 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python

on:
push:
branches:
- '**'
paths:
- '.github/workflows/python.yml'
- '**.py'
- '**.pyi'
- 'Makefile'
pull_request:
branches:
- '**'
paths:
- '.github/workflows/python.yml'
- '**.py'
- '**.pyi'
- 'Makefile'

jobs:
job_lint:
name: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}

env:
UV_SYSTEM_PYTHON: 1

strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.8']

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install -U uv
make install-dev
- name: Do linting
run: |
make ci-check
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sublime Text files
ace-jump.sublime-project
ace-jump.sublime-workspace

# To do
*.TODO
.mypy_cache
.tox
.venv-*/
.venv/
__pycache__
node_modules
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
UV_INSTALL_FLAGS :=

.PHONY: all
all:

.PHONY: install
install:
uv pip install $(UV_INSTALL_FLAGS) -r requirements.txt

.PHONY: install-dev
install-dev:
uv pip install $(UV_INSTALL_FLAGS) -r requirements-dev.txt

.PHONY: pip-compile
pip-compile:
uv pip compile --upgrade requirements.in -o requirements.txt
uv pip compile --upgrade requirements-dev.in -o requirements-dev.txt

.PHONY: update-changelog
update-changelog:
git cliff --output=CHANGELOG.md

.PHONY: ci-check
ci-check:
@echo "========== check: mypy =========="
mypy ace_jump.py
@echo "========== check: ruff (lint) =========="
ruff check --diff .
@echo "========== check: ruff (format) =========="
ruff format --diff .

.PHONY: ci-fix
ci-fix:
@echo "========== fix: ruff (lint) =========="
ruff check --fix .
@echo "========== fix: ruff (format) =========="
ruff format .
Loading

0 comments on commit 6776224

Please sign in to comment.