diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1359c86 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + - id: mixed-line-ending + - id: trailing-whitespace + - repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black + - repo: https://github.com/asottile/blacken-docs + rev: 1.15.0 + hooks: + - id: blacken-docs + args: [--skip-errors, --skip-string-normalization] + - repo: https://github.com/timothycrosley/isort + rev: 5.12.0 + hooks: + - id: isort diff --git a/LICENSE b/LICENSE index da82622..1815bb7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Jordan Cook +Copyright (c) 2023 Jordan Cook Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index a04970c..fc9cc62 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SOURCE_DIR = pages BUILD_DIR = _build/html TAGS_DIR = pages/tags -all: clean docs linkcheck size publish +all: clean lint docs linkcheck size publish clean: rm -rf $(BUILD_DIR) $(TAGS_DIR) @@ -11,6 +11,9 @@ clean: docs: sphinx-build $(SOURCE_DIR) $(BUILD_DIR) +lint: + pre-commit run --all + linkcheck: sphinx-build -b linkcheck $(SOURCE_DIR) $(BUILD_DIR) diff --git a/README.md b/README.md index 92c46af..78196b2 100644 --- a/README.md +++ b/README.md @@ -25,4 +25,4 @@ make livedocs Publish to tilde.team: ```bash make publish -``` \ No newline at end of file +``` diff --git a/assets/dotfiles/.project b/assets/dotfiles/.project index 68f5dbf..be59797 100644 --- a/assets/dotfiles/.project +++ b/assets/dotfiles/.project @@ -1,4 +1,4 @@ * Python HTTP caching: https://github.com/requests-cache * Python biodiversity data access: https://github.com/pyinat * Other open source projects: https://github.com/jwcook -* Macro photography: https://www.flickr.com/people/jcook83 \ No newline at end of file +* Macro photography: https://www.flickr.com/people/jcook83 diff --git a/assets/js/style.js b/assets/js/style.js index 8273d70..52a6b1d 100644 --- a/assets/js/style.js +++ b/assets/js/style.js @@ -1,3 +1,3 @@ // Furo supports light and dark modes, with auto-detect. Disabling this to go with dark theme only. document.body.dataset.theme = "dark"; -localStorage.setItem("theme", "dark"); \ No newline at end of file +localStorage.setItem("theme", "dark"); diff --git a/pages/about_site.md b/pages/about_site.md index b9c3280..cf7bb63 100644 --- a/pages/about_site.md +++ b/pages/about_site.md @@ -10,4 +10,4 @@ Source code can be found here: https://tildegit.org/jwcook/jwcook.tilde.team If you have any questions about how this site is built, or are interested in using Sphinx and/or MyST to set up your own site in the tildeverse, you are welcome to -[drop me a line](mailto:jwcook@tilde.team). \ No newline at end of file +[drop me a line](mailto:jwcook@tilde.team). diff --git a/pages/asdf.md b/pages/asdf.md index 938b2c1..83b9d21 100644 --- a/pages/asdf.md +++ b/pages/asdf.md @@ -5,4 +5,4 @@ todo lorem_ipsum md_test -``` \ No newline at end of file +``` diff --git a/pages/lorem_ipsum.md b/pages/lorem_ipsum.md index 40408e9..521f573 100644 --- a/pages/lorem_ipsum.md +++ b/pages/lorem_ipsum.md @@ -9,4 +9,4 @@ Urna id volutpat lacus laoreet non. Mi tempus imperdiet nulla malesuada pellente Tincidunt nunc pulvinar sapien et. Diam quam nulla porttitor massa id neque aliquam vestibulum morbi. Sed velit dignissim sodales ut. Quam viverra orci sagittis eu volutpat odio facilisis. Laoreet non curabitur gravida arcu ac tortor dignissim. Auctor elit sed vulputate mi sit amet mauris. Egestas dui id ornare arcu odio ut. Faucibus scelerisque eleifend donec pretium vulputate sapien nec. Lacinia quis vel eros donec ac odio tempor. Velit euismod in pellentesque massa placerat duis ultricies lacus sed. Dapibus ultrices in iaculis nunc sed augue lacus. Mauris commodo quis imperdiet massa tincidunt nunc pulvinar sapien. Pharetra pharetra massa massa ultricies mi quis hendrerit dolor magna. -Ipsum dolor sit amet consectetur adipiscing. Libero justo laoreet sit amet cursus sit amet dictum sit. Sed velit dignissim sodales ut. Tempus urna et pharetra pharetra massa massa ultricies mi quis. Ac placerat vestibulum lectus mauris. Nisl nunc mi ipsum faucibus vitae aliquet nec ullamcorper. Risus pretium quam vulputate dignissim suspendisse in est ante in. Sit amet mauris commodo quis imperdiet massa. Et sollicitudin ac orci phasellus egestas tellus. Volutpat commodo sed egestas egestas fringilla. Sit amet consectetur adipiscing elit. Morbi enim nunc faucibus a pellentesque sit amet porttitor. Donec pretium vulputate sapien nec sagittis aliquam malesuada bibendum arcu. Lectus quam id leo in vitae turpis massa sed. Morbi quis commodo odio aenean sed adipiscing diam donec. Ipsum faucibus vitae aliquet nec. \ No newline at end of file +Ipsum dolor sit amet consectetur adipiscing. Libero justo laoreet sit amet cursus sit amet dictum sit. Sed velit dignissim sodales ut. Tempus urna et pharetra pharetra massa massa ultricies mi quis. Ac placerat vestibulum lectus mauris. Nisl nunc mi ipsum faucibus vitae aliquet nec ullamcorper. Risus pretium quam vulputate dignissim suspendisse in est ante in. Sit amet mauris commodo quis imperdiet massa. Et sollicitudin ac orci phasellus egestas tellus. Volutpat commodo sed egestas egestas fringilla. Sit amet consectetur adipiscing elit. Morbi enim nunc faucibus a pellentesque sit amet porttitor. Donec pretium vulputate sapien nec sagittis aliquam malesuada bibendum arcu. Lectus quam id leo in vitae turpis massa sed. Morbi quis commodo odio aenean sed adipiscing diam donec. Ipsum faucibus vitae aliquet nec. diff --git a/pages/open_source.md b/pages/open_source.md index dcd1d18..8862c8a 100644 --- a/pages/open_source.md +++ b/pages/open_source.md @@ -41,4 +41,4 @@ relatively small niche that no other tools (that I know of) currently fill. ## Getting involved If you are a python developer looking for ways to get involved in open source, I am willing to -mentor new contributors on any of these projects. Feel free to reach out either here or on GitHub. \ No newline at end of file +mentor new contributors on any of these projects. Feel free to reach out either here or on GitHub. diff --git a/pages/photography.md b/pages/photography.md index 4f7d723..d3b7488 100644 --- a/pages/photography.md +++ b/pages/photography.md @@ -116,4 +116,3 @@ insects, spiders, and other tiny curiosities. ``` [_Artomyces pyxidatus_ (Crown-tipped Coral Fungus)](https://flickr.com/photos/jcook83/48921844066) ::: - diff --git a/pages/succulents.md b/pages/succulents.md index 916ef9d..50c98a5 100644 --- a/pages/succulents.md +++ b/pages/succulents.md @@ -86,4 +86,3 @@ and photograph some plants in a small indoor garden. ``` [_Dioscorea elephantipes_ (Elephant's Foot)](https://flickr.com/photos/jcook83/50552435987) ::: - diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3418e89 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,8 @@ +[tool.black] +skip-string-normalization = true +line-length = 100 + +[tool.isort] +profile = 'black' +line_length = 100 +skip_gitignore = true diff --git a/requirements.txt b/requirements.txt index 79d875c..c788804 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,6 @@ sphinx-copybutton>=0.5 sphinx-design>=0.4 sphinx-notfound-page>=0.8 sphinx-tags>=0.2 + +# dev tools; not required for doc builds +pre-commit~=3.0 \ No newline at end of file