forked from asciipip/greenbutton-python
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from vladistan/add-pre-commit
Add pre commit
- Loading branch information
Showing
37 changed files
with
330 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow runs pre-commit hooks on pushes and pull requests to main | ||
# to enforce coding style. To ensure correct configuration, please refer to: | ||
# https://lincc-ppt.readthedocs.io/en/latest/practices/ci_precommit.html | ||
name: Run pre-commit hooks | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
pre-commit-ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
python -m pip install --upgrade pip | ||
pip install .[dev] | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- uses: pre-commit/action@v3.0.1 | ||
with: | ||
extra_args: --all-files --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
repos: | ||
|
||
- repo: https://github.com/abravalheri/validate-pyproject | ||
rev: v0.12.1 | ||
hooks: | ||
- id: validate-pyproject | ||
|
||
- repo: https://github.com/rhysd/actionlint | ||
rev: v1.6.26 | ||
hooks: | ||
- id: actionlint | ||
|
||
- repo: https://github.com/sirosen/check-jsonschema | ||
rev: 0.27.3 | ||
hooks: | ||
- id: check-github-actions | ||
- id: check-github-workflows | ||
- id: check-readthedocs | ||
|
||
- repo: https://github.com/pappasam/toml-sort | ||
rev: v0.23.1 | ||
hooks: | ||
- id: toml-sort-fix | ||
stages: ["pre-commit"] | ||
|
||
- repo: meta | ||
hooks: | ||
- id: check-useless-excludes | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.5.5 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix, --show-fixes] | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-added-large-files | ||
args: ['--maxkb=500'] | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-case-conflict | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-shebang-scripts-are-executable | ||
- id: check-symlinks | ||
- id: check-toml | ||
- id: check-vcs-permalinks | ||
- id: check-xml | ||
- id: check-yaml | ||
args: [--unsafe] | ||
- id: debug-statements | ||
- id: destroyed-symlinks | ||
- id: end-of-file-fixer | ||
types: [python] | ||
- id: fix-byte-order-marker | ||
- id: mixed-line-ending | ||
- id: name-tests-test | ||
args: [--pytest-test-first] | ||
- id: no-commit-to-branch | ||
stages: | ||
- pre-push | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: debug-statements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
|
||
* Handle IntervalReading blocks without timePeriod entries. | ||
Synthesize a timePeriod from MeterReading.readingType.intervalLength. | ||
|
||
* Handle LocalTimeParameters resources | ||
|
||
* Handle ElectricPowerUsageSummary resources | ||
|
||
* Handle ElectricPowerQualitySummary resources | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
from enum import Enum | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.