Skip to content

Commit

Permalink
chore: switch to nix pre commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Ryall committed Jan 12, 2025
1 parent 7ef21e0 commit 66806e4
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 189 deletions.
141 changes: 4 additions & 137 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,138 +1,5 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# MAc
.DS_Store

.vscode
*.picklecache

.pre-commit-config.yaml
.direnv
.pdm-python
src/fava_envelope/__pycache__
src/fava_envelope/cli/__pycache__/__main__.cpython-311.pyc
.venv
51 changes: 0 additions & 51 deletions .pre-commit-config.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .pre-commit-config.yaml
60 changes: 60 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 24 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
inputs.uv2nix.follows = "uv2nix";
inputs.nixpkgs.follows = "nixpkgs";
};

git-hooks-nix = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = {
Expand All @@ -33,6 +38,7 @@
uv2nix,
pyproject-nix,
pyproject-build-systems,
git-hooks-nix,
...
} @ inputs:
flake-parts.lib.mkFlake
Expand All @@ -45,7 +51,15 @@
"aarch64-darwin"
];

perSystem = {system, ...}: let
imports = [
git-hooks-nix.flakeModule
];

perSystem = {
config,
system,
...
}: let
inherit (nixpkgs) lib;
pkgs = import nixpkgs {
inherit system;
Expand Down Expand Up @@ -110,6 +124,14 @@
]
);
in {
pre-commit.settings.hooks = {
# ruff.enable = true;
};

# isort.enable = true;
# pyupgrade.enable = true;
# flake8.enable = true;

devShells.default = let
pkgs = nixpkgs.legacyPackages.${system};
editablePythonSet = pythonSets.overrideScope editableOverlay;
Expand All @@ -130,6 +152,7 @@
shellHook = ''
unset PYTHONPATH
export REPO_ROOT=$(git rev-parse --show-toplevel)
${config.pre-commit.installationScript}
'';
};
packages = {
Expand Down

0 comments on commit 66806e4

Please sign in to comment.