Skip to content

Commit

Permalink
Reformatted files + pre-commit hook (#201)
Browse files Browse the repository at this point in the history
* Reformatted files + pre-commit hook

* Update requirements

* Adds install instructions for the pre-commit hook
  • Loading branch information
domna authored Dec 19, 2023
1 parent 7f14b61 commit 7cf3de5
Show file tree
Hide file tree
Showing 96 changed files with 7,222 additions and 4,490 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.7
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ python -m pip install -e .
python -m pip install -e ".[dev]"
```

There is also a [pre-commit hook](https://pre-commit.com/#intro) available
which formats the code and checks the linting before actually commiting.
It can be installed with
```shell
pre-commit install
```
from the root of this repository.

## Test this software

Especially relevant for developers, there exists a basic test framework written in
Expand Down
16 changes: 16 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ cattrs==23.2.2
# via requests-cache
certifi==2023.11.17
# via requests
cfgv==3.4.0
# via pre-commit
charset-normalizer==3.3.2
# via requests
click==8.1.7
Expand Down Expand Up @@ -77,6 +79,8 @@ diffsims==0.5.2
# pyxem
dill==0.3.7
# via hyperspy
distlib==0.3.7
# via virtualenv
entrypoints==0.4
# via ipyparallel
exceptiongroup==1.2.0
Expand All @@ -91,6 +95,8 @@ fabio==2023.10.0
# silx
fasteners==0.19
# via zarr
filelock==3.13.1
# via virtualenv
flatdict==4.0.1
# via pynxtools (pyproject.toml)
fonttools==4.45.1
Expand Down Expand Up @@ -125,6 +131,8 @@ hyperspy==1.7.6
# kikuchipy
# pynxtools (pyproject.toml)
# pyxem
identify==2.5.33
# via pre-commit
idna==3.6
# via requests
ifes-apt-tc-data-modeling==0.1
Expand Down Expand Up @@ -236,6 +244,8 @@ nionutils==0.4.6
# nionswift
# nionswift-io
# nionui
nodeenv==1.8.0
# via pre-commit
numba==0.58.1
# via
# diffsims
Expand Down Expand Up @@ -340,6 +350,7 @@ platformdirs==4.0.0
# jupyter-core
# pooch
# requests-cache
# virtualenv
pluggy==1.3.0
# via pytest
ply==3.11
Expand All @@ -348,6 +359,8 @@ pooch==1.8.0
# via
# kikuchipy
# orix
pre-commit==3.5.0
# via pynxtools (pyproject.toml)
prettytable==3.9.0
# via hyperspy
prompt-toolkit==3.0.41
Expand Down Expand Up @@ -406,6 +419,7 @@ pyyaml==6.0.1
# dask
# hyperspy
# kikuchipy
# pre-commit
# pynxtools (pyproject.toml)
pyzmq==25.1.1
# via
Expand Down Expand Up @@ -548,6 +562,8 @@ urllib3==2.1.0
# requests
# requests-cache
# types-requests
virtualenv==20.25.0
# via pre-commit
wcwidth==0.2.12
# via
# prettytable
Expand Down
Loading

0 comments on commit 7cf3de5

Please sign in to comment.