Skip to content

Commit

Permalink
add pre-commit-config.yaml and fix formatting (#3)
Browse files Browse the repository at this point in the history
* add pre-commit-config.yaml and fix formatting

* formatting code

* add .git-blame-ignore-revs and pre-commit.yml

* fixup! formatting code
  • Loading branch information
shenxianpeng authored Oct 30, 2024
1 parent 8080b60 commit 1b3da45
Show file tree
Hide file tree
Showing 65 changed files with 4,217 additions and 2,914 deletions.
11 changes: 11 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Since version 2.23 (released in August 2019), git-blame has a feature
# to ignore or bypass certain commits.
#
# This file contains a list of commits that are not likely what you
# are looking for in a blame, such as mass reformatting or renaming.
# You can set this file as a default ignore file for blame by running
# the following command.
#
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs
# code format - https://github.com/RocketSoftware/uopy-demo/pull/3
2fd503020220ba3c283aedae77f5051d21ae34d1
27 changes: 27 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pre-Commit Checks

on:
pull_request:
branches:
- main

jobs:
pre-commit:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12' # or any version compatible with pre-commit hooks

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

examples/uopy_tkexample/logs/
examples/uopy_web/logs/
.venv/
.ruff_cache/
venv/

examples/uopy_tkexample/logs/
examples/uopy_web/logs/
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: '\.(html|css|js)$|^docs/'
- id: end-of-file-fixer
exclude: '\.(html|css|js)$|^docs/'
- id: check-docstring-first
- id: check-added-large-files
- id: check-yaml
- id: check-toml
- id: requirements-txt-fixer
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black
# - repo: https://github.com/codespell-project/codespell
# rev: v2.3.0
# hooks:
# - id: codespell
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ pip install uopy

## Quick start

**Before using UOPY to connect to an MV Database, you must be running either a [UniVerse](https://www.rocketsoftware.com/products/rocket-universe-0/rocket-universe) or [UniData](https://www.rocketsoftware.com/products/rocket-unidata-0/rocket-unidata) server.**
**Before using UOPY to connect to an MV Database, you must be running either a [UniVerse](https://www.rocketsoftware.com/products/rocket-universe-0/rocket-universe) or [UniData](https://www.rocketsoftware.com/products/rocket-unidata-0/rocket-unidata) server.**

The following example uses UOPY to connect to UniVerse on Windows.

Expand Down
Loading

0 comments on commit 1b3da45

Please sign in to comment.