Skip to content

Commit

Permalink
Merge pull request #55 from JecaTosovic/add_pre_commit
Browse files Browse the repository at this point in the history
Add pre commit
  • Loading branch information
JecaTosovic authored Apr 9, 2024
2 parents f48d7dc + 6348b92 commit adb7b09
Show file tree
Hide file tree
Showing 33 changed files with 85,138 additions and 84,940 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ updates:
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 10
open-pull-requests-limit: 10
2 changes: 1 addition & 1 deletion .github/workflows/envs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:

dependencies:
- pip:
- -r ../../../requirements/requirements-test.txt
- -r ../../../requirements/requirements-test.txt
3 changes: 1 addition & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ci:
autoupdate_schedule: quarterly

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.5.0'
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-builtin-literals
- id: check-executables-have-shebangs
- id: check-yaml
- id: debug-statements
- id: requirements-txt-fixer
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.2
hooks:
# Run the linter.
- id: ruff
types_or: [ python, pyi, jupyter ]
args: [ --fix ]
# Run the formatter.
- id: ruff-format
types_or: [ python, pyi, jupyter ]
66 changes: 66 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
target-version = "py38"

[lint]
select = [
"A",
"B",
"D",
"E501",
"EM",
"E",
"F",
"I",
"ICN",
"ISC",
"N",
"NPY",
"PL",
"PT",
"RET",
"RUF",
"UP",
"W",
]

ignore = [
"D107", # Do not document __init__ separately from the class.
"D105",
"D103",
"D100",
"N806",
"N802",
"N813",
"PLR0913",
"PLR0912",
"PLR0915",
"PLR2004",
"ISC001",
"N803",
"D200",
"N999",
]

[lint.per-file-ignores]

"*/__init__.py" = ["F401", # __init__.py import submodules for use by the package importer.
"D104",
"N999",
"D205",
"D415",
"E501"
]

"tests/*.py" = ["PLR2004", # unit test value comparisons are not magic values
"N999",
"D104"
]

"docs/source/conf.py" = ["A001", # Allow copyright variable name
"D", # conf.py does not need documentation
]

[lint.pydocstyle]
convention = "google"

[format]
quote-style = "double"
3 changes: 1 addition & 2 deletions ConservedWaterSearch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
"""
ConservedWaterSearch
"""ConservedWaterSearch
Module for identification of conserved waters from MD trajetory
"""
Loading

0 comments on commit adb7b09

Please sign in to comment.