From 2c1866e9fe3d7525c1e6cee379f0fcad069be5e0 Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:09:52 -0400 Subject: [PATCH 01/11] Add `python` as a package --- flake.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flake.nix b/flake.nix index edd93cf..cb891d7 100644 --- a/flake.nix +++ b/flake.nix @@ -13,10 +13,13 @@ inherit system; }; + python = pkgs.python311; + in { devShells.default = pkgs.mkShell { packages = [ + python pkgs.nixpkgs-fmt ]; }; From 67f7f89291169bd496d235ac44d1bea5931af679 Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:10:31 -0400 Subject: [PATCH 02/11] Add `pyproject.toml` --- pyproject.toml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6c9b939 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ['setuptools'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'ember' +description = 'simple rate-based multitasking and core libraries for microcontrollers' +version = '0.0.0' + +authors = [ + {name = 'Ember Developers'}, +] +license = {'text' = 'GPL-3.0-only'} + +requires-python = '>=3.11' +dependencies = [ + 'pip-tools', +] + +[project.urls] +repo = 'https://github.com/CooperUnion/ember' + +[tool.pip-tools] +allow-unsafe = true +generate-hashes = true +strip-extras = false +upgrade = true +verbose = true + +[tool.setuptools.packages.find] +exclude = ['*'] From 72b1bbe75b35b26ba7acd9ea6177116d3308ba5e Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:12:40 -0400 Subject: [PATCH 03/11] Add `requirements.txt` --- requirements.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4218b26 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,40 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile --allow-unsafe --generate-hashes +# +build==1.0.3 \ + --hash=sha256:538aab1b64f9828977f84bc63ae570b060a8ed1be419e7870b8b4fc5e6ea553b \ + --hash=sha256:589bf99a67df7c9cf07ec0ac0e5e2ea5d4b37ac63301c4986d1acb126aa83f8f + # via pip-tools +click==8.1.7 \ + --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ + --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de + # via pip-tools +packaging==23.2 \ + --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ + --hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7 + # via build +pip-tools==7.3.0 \ + --hash=sha256:8717693288720a8c6ebd07149c93ab0be1fced0b5191df9e9decd3263e20d85e \ + --hash=sha256:8e9c99127fe024c025b46a0b2d15c7bd47f18f33226cf7330d35493663fc1d1d + # via ember (pyproject.toml) +pyproject-hooks==1.0.0 \ + --hash=sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8 \ + --hash=sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5 + # via build +wheel==0.41.3 \ + --hash=sha256:488609bc63a29322326e05560731bf7bfea8e48ad646e1f5e40d366607de0942 \ + --hash=sha256:4d4987ce51a49370ea65c0bfd2234e8ce80a12780820d9dc462597a6e60d0841 + # via pip-tools + +# The following packages are considered to be unsafe in a requirements file: +pip==23.3.1 \ + --hash=sha256:1fcaa041308d01f14575f6d0d2ea4b75a3e2871fe4f9c694976f908768e14174 \ + --hash=sha256:55eb67bb6171d37447e82213be585b75fe2b12b359e993773aca4de9247a052b + # via pip-tools +setuptools==68.2.2 \ + --hash=sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87 \ + --hash=sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a + # via pip-tools From e1c0d9ed556f8b4a15c38d927f47c328dad4728c Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:13:32 -0400 Subject: [PATCH 04/11] Automatically create virtual environment --- .envrc | 36 ++++++++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 37 insertions(+) diff --git a/.envrc b/.envrc index 28ce776..da78a41 100644 --- a/.envrc +++ b/.envrc @@ -3,4 +3,40 @@ strict_env direnv_version '2.32.3' +COLOR_MAGENTA="\033[1;35m" + +FORMAT_BOLD="\033[1m" +FORMAT_NONE="\033[0m" + +MSG_INFO="${FORMAT_BOLD}${COLOR_MAGENTA}info:${FORMAT_NONE}" + +msg_info() +{ + printf '%b %s\n' "$MSG_INFO" "$1" +} + + use flake + + +export VIRTUAL_ENV=$(expand_path .venv) + +if [ ! -d "$VIRTUAL_ENV" ]; then + msg_info "creating \`$VIRTUAL_ENV\` because it doesn't seem to exist" + + python -m venv "$VIRTUAL_ENV" +fi + +if [ -n "${FISH_VERISON-}" ]; then + . "$VIRTUAL_ENV/bin/activate.fish" +else + . "$VIRTUAL_ENV/bin/activate" +fi + +if [ ! -f "$VIRTUAL_ENV/.requirements-installed" ]; then + msg_info 'installing python requirements since they seem to be missing' + + pip install -r 'requirements.txt' + + touch "$VIRTUAL_ENV/.requirements-installed" +fi diff --git a/.gitignore b/.gitignore index 92b2793..59df265 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .direnv +.venv From 62e64362a3bc9611025c65ceca757c15b046ef1c Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:15:54 -0400 Subject: [PATCH 05/11] Add `.pre-commit-config.yaml` --- .envrc | 3 + .pre-commit-config.yaml | 43 +++++++++ .yamllint.yml | 6 ++ pyproject.toml | 10 ++ requirements.txt | 203 +++++++++++++++++++++++++++++++++++++++- 5 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 .yamllint.yml diff --git a/.envrc b/.envrc index da78a41..97d0949 100644 --- a/.envrc +++ b/.envrc @@ -40,3 +40,6 @@ if [ ! -f "$VIRTUAL_ENV/.requirements-installed" ]; then touch "$VIRTUAL_ENV/.requirements-installed" fi + + +pre-commit install diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a861b13 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,43 @@ +--- +# See https://pre-commit.com for more information + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + - id: check-json + - id: check-merge-conflict + - id: check-shebang-scripts-are-executable + - id: check-symlinks + - id: check-toml + - id: check-xml + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + + - repo: https://github.com/executablebooks/mdformat + rev: 0.7.17 + hooks: + - id: mdformat + args: + - --wrap + - '72' + exclude: LICENSE\.md + additional_dependencies: + - mdformat-gfm + + - repo: https://github.com/nix-community/nixpkgs-fmt + rev: v1.3.0 + hooks: + - id: nixpkgs-fmt + + - repo: https://github.com/lyz-code/yamlfix/ + rev: 1.13.0 + hooks: + - id: yamlfix + + - repo: https://github.com/adrienverge/yamllint + rev: v1.32.0 + hooks: + - id: yamllint diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..a0bc324 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,6 @@ +--- + +extends: default + +ignore-from-file: + - .gitignore diff --git a/pyproject.toml b/pyproject.toml index 6c9b939..efaf2f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,11 @@ license = {'text' = 'GPL-3.0-only'} requires-python = '>=3.11' dependencies = [ + 'mdformat-gfm', 'pip-tools', + 'pre-commit', + 'yamlfix', + 'yamllint', ] [project.urls] @@ -29,3 +33,9 @@ verbose = true [tool.setuptools.packages.find] exclude = ['*'] + +[tool.yamlfix] +none_representation = '~' +section_whitelines = 1 +sequence_style = 'block_style' +whitelines = 1 diff --git a/requirements.txt b/requirements.txt index 4218b26..3424306 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,26 +8,222 @@ build==1.0.3 \ --hash=sha256:538aab1b64f9828977f84bc63ae570b060a8ed1be419e7870b8b4fc5e6ea553b \ --hash=sha256:589bf99a67df7c9cf07ec0ac0e5e2ea5d4b37ac63301c4986d1acb126aa83f8f # via pip-tools +cfgv==3.4.0 \ + --hash=sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9 \ + --hash=sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560 + # via pre-commit click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de - # via pip-tools + # via + # maison + # pip-tools + # yamlfix +distlib==0.3.7 \ + --hash=sha256:2e24928bc811348f0feb63014e97aaae3037f2cf48712d51ae61df7fd6075057 \ + --hash=sha256:9dafe54b34a028eafd95039d5e5d4851a13734540f1331060d31c9916e7147a8 + # via virtualenv +distro==1.8.0 \ + --hash=sha256:02e111d1dc6a50abb8eed6bf31c3e48ed8b0830d1ea2a1b78c61765c2513fdd8 \ + --hash=sha256:99522ca3e365cac527b44bde033f64c6945d90eb9f769703caaec52b09bbd3ff + # via ruyaml +filelock==3.13.1 \ + --hash=sha256:521f5f56c50f8426f5e03ad3b281b490a87ef15bc6c526f168290f0c7148d44e \ + --hash=sha256:57dbda9b35157b05fb3e58ee91448612eb674172fab98ee235ccb0b5bee19a1c + # via virtualenv +identify==2.5.31 \ + --hash=sha256:7736b3c7a28233637e3c36550646fc6389bedd74ae84cb788200cc8e2dd60b75 \ + --hash=sha256:90199cb9e7bd3c5407a9b7e81b4abec4bb9d249991c79439ec8af740afc6293d + # via pre-commit +linkify-it-py==2.0.2 \ + --hash=sha256:19f3060727842c254c808e99d465c80c49d2c7306788140987a1a7a29b0d6ad2 \ + --hash=sha256:a3a24428f6c96f27370d7fe61d2ac0be09017be5190d68d8658233171f1b6541 + # via markdown-it-py +maison==1.4.0 \ + --hash=sha256:591a6ffe972558685cf2c3fdbff3dfa1e6b57a0227c50d387426ab9745e5939b \ + --hash=sha256:9843758d7772e0fc3ca93cf3abfdd39656f41bc75f026fd8bfb5a0ac17f27a7e + # via yamlfix +markdown-it-py[linkify]==2.2.0 \ + --hash=sha256:5a35f8d1870171d9acc47b99612dc146129b631baf04970128b568f190d0cc30 \ + --hash=sha256:7c9a5e412688bc771c67432cbfebcdd686c93ce6484913dccf06cb5a0bea35a1 + # via + # mdformat + # mdformat-gfm + # mdit-py-plugins +mdformat==0.7.17 \ + --hash=sha256:91ffc5e203f5814a6ad17515c77767fd2737fc12ffd8b58b7bb1d8b9aa6effaa \ + --hash=sha256:a9dbb1838d43bb1e6f03bd5dca9412c552544a9bc42d6abb5dc32adfe8ae7c0d + # via + # mdformat-gfm + # mdformat-tables +mdformat-gfm==0.3.5 \ + --hash=sha256:1e627edc7665b59e008b3b9e5decc18c40cbd625c196d77e5ea3bc624e80ac8a \ + --hash=sha256:5ee5f0de1d3b56d5edfced023bfff0aeed958be328e5460dac3221ac1b61ce7c + # via ember (pyproject.toml) +mdformat-tables==0.4.1 \ + --hash=sha256:3024e88e9d29d7b8bb07fd6b59c9d5dcf14d2060122be29e30e72d27b65d7da9 \ + --hash=sha256:981f3dc7350027f78e3fd6a5fe8a16e123eec423af2d140e588d855751501019 + # via mdformat-gfm +mdit-py-plugins==0.3.5 \ + --hash=sha256:ca9a0714ea59a24b2b044a1831f48d817dd0c817e84339f20e7889f392d77c4e \ + --hash=sha256:eee0adc7195e5827e17e02d2a258a2ba159944a0748f59c5099a4a27f78fcf6a + # via mdformat-gfm +mdurl==0.1.2 \ + --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \ + --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba + # via markdown-it-py +nodeenv==1.8.0 \ + --hash=sha256:d51e0c37e64fbf47d017feac3145cdbb58836d7eee8c6f6d3b6880c5456227d2 \ + --hash=sha256:df865724bb3c3adc86b3876fa209771517b0cfe596beff01a92700e0e8be4cec + # via pre-commit packaging==23.2 \ --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ --hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7 # via build +pathspec==0.11.2 \ + --hash=sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20 \ + --hash=sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3 + # via yamllint pip-tools==7.3.0 \ --hash=sha256:8717693288720a8c6ebd07149c93ab0be1fced0b5191df9e9decd3263e20d85e \ --hash=sha256:8e9c99127fe024c025b46a0b2d15c7bd47f18f33226cf7330d35493663fc1d1d # via ember (pyproject.toml) +platformdirs==3.11.0 \ + --hash=sha256:cf8ee52a3afdb965072dcc652433e0c7e3e40cf5ea1477cd4b3b1d2eb75495b3 \ + --hash=sha256:e9d171d00af68be50e9202731309c4e658fd8bc76f55c11c7dd760d023bda68e + # via virtualenv +pre-commit==3.5.0 \ + --hash=sha256:5804465c675b659b0862f07907f96295d490822a450c4c40e747d0b1c6ebcb32 \ + --hash=sha256:841dc9aef25daba9a0238cd27984041fa0467b4199fc4852e27950664919f660 + # via ember (pyproject.toml) +pydantic==1.10.13 \ + --hash=sha256:1740068fd8e2ef6eb27a20e5651df000978edce6da6803c2bef0bc74540f9548 \ + --hash=sha256:210ce042e8f6f7c01168b2d84d4c9eb2b009fe7bf572c2266e235edf14bacd80 \ + --hash=sha256:32c8b48dcd3b2ac4e78b0ba4af3a2c2eb6048cb75202f0ea7b34feb740efc340 \ + --hash=sha256:3ecea2b9d80e5333303eeb77e180b90e95eea8f765d08c3d278cd56b00345d01 \ + --hash=sha256:4b03e42ec20286f052490423682016fd80fda830d8e4119f8ab13ec7464c0132 \ + --hash=sha256:4c5370a7edaac06daee3af1c8b1192e305bc102abcbf2a92374b5bc793818599 \ + --hash=sha256:56e3ff861c3b9c6857579de282ce8baabf443f42ffba355bf070770ed63e11e1 \ + --hash=sha256:5a1f9f747851338933942db7af7b6ee8268568ef2ed86c4185c6ef4402e80ba8 \ + --hash=sha256:5e08865bc6464df8c7d61439ef4439829e3ab62ab1669cddea8dd00cd74b9ffe \ + --hash=sha256:61d9dce220447fb74f45e73d7ff3b530e25db30192ad8d425166d43c5deb6df0 \ + --hash=sha256:654db58ae399fe6434e55325a2c3e959836bd17a6f6a0b6ca8107ea0571d2e17 \ + --hash=sha256:678bcf5591b63cc917100dc50ab6caebe597ac67e8c9ccb75e698f66038ea953 \ + --hash=sha256:6cf25c1a65c27923a17b3da28a0bdb99f62ee04230c931d83e888012851f4e7f \ + --hash=sha256:75ac15385a3534d887a99c713aa3da88a30fbd6204a5cd0dc4dab3d770b9bd2f \ + --hash=sha256:75b297827b59bc229cac1a23a2f7a4ac0031068e5be0ce385be1462e7e17a35d \ + --hash=sha256:7d6f6e7305244bddb4414ba7094ce910560c907bdfa3501e9db1a7fd7eaea127 \ + --hash=sha256:84bafe2e60b5e78bc64a2941b4c071a4b7404c5c907f5f5a99b0139781e69ed8 \ + --hash=sha256:854223752ba81e3abf663d685f105c64150873cc6f5d0c01d3e3220bcff7d36f \ + --hash=sha256:8ae5dd6b721459bfa30805f4c25880e0dd78fc5b5879f9f7a692196ddcb5a580 \ + --hash=sha256:8ef467901d7a41fa0ca6db9ae3ec0021e3f657ce2c208e98cd511f3161c762c6 \ + --hash=sha256:968ac42970f57b8344ee08837b62f6ee6f53c33f603547a55571c954a4225691 \ + --hash=sha256:97cce3ae7341f7620a0ba5ef6cf043975cd9d2b81f3aa5f4ea37928269bc1b87 \ + --hash=sha256:9849f031cf8a2f0a928fe885e5a04b08006d6d41876b8bbd2fc68a18f9f2e3fd \ + --hash=sha256:9f00790179497767aae6bcdc36355792c79e7bbb20b145ff449700eb076c5f96 \ + --hash=sha256:b87326822e71bd5f313e7d3bfdc77ac3247035ac10b0c0618bd99dcf95b1e687 \ + --hash=sha256:b97c1fac8c49be29486df85968682b0afa77e1b809aff74b83081cc115e52f33 \ + --hash=sha256:bc0898c12f8e9c97f6cd44c0ed70d55749eaf783716896960b4ecce2edfd2d69 \ + --hash=sha256:c553f6a156deb868ba38a23cf0df886c63492e9257f60a79c0fd8e7173537653 \ + --hash=sha256:c636925f38b8db208e09d344c7aa4f29a86bb9947495dd6b6d376ad10334fb78 \ + --hash=sha256:c958d053453a1c4b1c2062b05cd42d9d5c8eb67537b8d5a7e3c3032943ecd261 \ + --hash=sha256:d3a3c792a58e1622667a2837512099eac62490cdfd63bd407993aaf200a4cf1f \ + --hash=sha256:e31647d85a2013d926ce60b84f9dd5300d44535a9941fe825dc349ae1f760df9 \ + --hash=sha256:e70ca129d2053fb8b728ee7d1af8e553a928d7e301a311094b8a0501adc8763d \ + --hash=sha256:efff03cc7a4f29d9009d1c96ceb1e7a70a65cfe86e89d34e4a5f2ab1e5693737 \ + --hash=sha256:f59ef915cac80275245824e9d771ee939133be38215555e9dc90c6cb148aaeb5 \ + --hash=sha256:f8e81fc5fb17dae698f52bdd1c4f18b6ca674d7068242b2aff075f588301bbb0 + # via maison pyproject-hooks==1.0.0 \ --hash=sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8 \ --hash=sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5 # via build +pyyaml==6.0.1 \ + --hash=sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5 \ + --hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \ + --hash=sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df \ + --hash=sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741 \ + --hash=sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206 \ + --hash=sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27 \ + --hash=sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595 \ + --hash=sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62 \ + --hash=sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98 \ + --hash=sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696 \ + --hash=sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290 \ + --hash=sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9 \ + --hash=sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d \ + --hash=sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6 \ + --hash=sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867 \ + --hash=sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47 \ + --hash=sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486 \ + --hash=sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6 \ + --hash=sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3 \ + --hash=sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007 \ + --hash=sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938 \ + --hash=sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0 \ + --hash=sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c \ + --hash=sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735 \ + --hash=sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d \ + --hash=sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28 \ + --hash=sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4 \ + --hash=sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba \ + --hash=sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8 \ + --hash=sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5 \ + --hash=sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd \ + --hash=sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3 \ + --hash=sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0 \ + --hash=sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515 \ + --hash=sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c \ + --hash=sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c \ + --hash=sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924 \ + --hash=sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34 \ + --hash=sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43 \ + --hash=sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859 \ + --hash=sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673 \ + --hash=sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54 \ + --hash=sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a \ + --hash=sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b \ + --hash=sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab \ + --hash=sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa \ + --hash=sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c \ + --hash=sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585 \ + --hash=sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d \ + --hash=sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f + # via + # pre-commit + # yamllint +ruyaml==0.91.0 \ + --hash=sha256:50e0ee3389c77ad340e209472e0effd41ae0275246df00cdad0a067532171755 \ + --hash=sha256:6ce9de9f4d082d696d3bde264664d1bcdca8f5a9dff9d1a1f1a127969ab871ab + # via yamlfix +toml==0.10.2 \ + --hash=sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b \ + --hash=sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f + # via maison +typing-extensions==4.8.0 \ + --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ + --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef + # via pydantic +uc-micro-py==1.0.2 \ + --hash=sha256:30ae2ac9c49f39ac6dce743bd187fcd2b574b16ca095fa74cd9396795c954c54 \ + --hash=sha256:8c9110c309db9d9e87302e2f4ad2c3152770930d88ab385cd544e7a7e75f3de0 + # via linkify-it-py +virtualenv==20.24.6 \ + --hash=sha256:02ece4f56fbf939dbbc33c0715159951d6bf14aaf5457b092e4548e1382455af \ + --hash=sha256:520d056652454c5098a00c0f073611ccbea4c79089331f60bf9d7ba247bb7381 + # via pre-commit wheel==0.41.3 \ --hash=sha256:488609bc63a29322326e05560731bf7bfea8e48ad646e1f5e40d366607de0942 \ --hash=sha256:4d4987ce51a49370ea65c0bfd2234e8ce80a12780820d9dc462597a6e60d0841 # via pip-tools +yamlfix==1.15.0 \ + --hash=sha256:22095f0aaa9a6c07b279385b3b567b1553d6cb12d6f2c41dd2bb0a4361efc70d \ + --hash=sha256:6aa50eac3b308ef8d31f5e0d0c36aa5c5bd46de4d8f943ae6cb62df60e8e7e72 + # via ember (pyproject.toml) +yamllint==1.32.0 \ + --hash=sha256:d01dde008c65de5b235188ab3110bebc59d18e5c65fc8a58267cd211cd9df34a \ + --hash=sha256:d97a66e48da820829d96077d76b8dfbe6c6140f106e558dae87e81ac4e6b30b7 + # via ember (pyproject.toml) # The following packages are considered to be unsafe in a requirements file: pip==23.3.1 \ @@ -37,4 +233,7 @@ pip==23.3.1 \ setuptools==68.2.2 \ --hash=sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87 \ --hash=sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a - # via pip-tools + # via + # nodeenv + # pip-tools + # ruyaml From e84e5332f5dad8fa18af11c463bef545e803f450 Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:16:48 -0400 Subject: [PATCH 06/11] Ignore `*.egg-info` --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 59df265..2fc70d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +*.egg-info .direnv .venv From 62fb4cdab014959f75950257be18419dcd73b064 Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:18:46 -0400 Subject: [PATCH 07/11] Apply `pre-commit` rules --- ember-bltools/ember_bltools.h | 1 - ember-tasking/ember_tasking.c | 1 - ember-tasking/watchdog.c | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ember-bltools/ember_bltools.h b/ember-bltools/ember_bltools.h index e126da2..9509db7 100644 --- a/ember-bltools/ember_bltools.h +++ b/ember-bltools/ember_bltools.h @@ -6,4 +6,3 @@ bool ember_bltools_set_boot_partition_to_factory(); #endif - diff --git a/ember-tasking/ember_tasking.c b/ember-tasking/ember_tasking.c index f7320d7..583da03 100644 --- a/ember-tasking/ember_tasking.c +++ b/ember-tasking/ember_tasking.c @@ -14,4 +14,3 @@ void ember_tasking_begin(void) { void ember_tasking_set_1sec_watchdog(void) { set_up_rtc_watchdog(1000); } - diff --git a/ember-tasking/watchdog.c b/ember-tasking/watchdog.c index 21478ad..806e61a 100644 --- a/ember-tasking/watchdog.c +++ b/ember-tasking/watchdog.c @@ -175,4 +175,4 @@ void set_up_rtc_watchdog_final() void set_up_rtc_watchdog_1sec() { set_up_rtc_watchdog(FW_UPDATE_TIMEOUT_MS); -} \ No newline at end of file +} From f5890c8a4114d30c6b82bbc740a24ea404d1d114 Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:20:15 -0400 Subject: [PATCH 08/11] Add `pkg.act` as a package --- flake.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index cb891d7..16492eb 100644 --- a/flake.nix +++ b/flake.nix @@ -19,8 +19,9 @@ { devShells.default = pkgs.mkShell { packages = [ - python + pkgs.act pkgs.nixpkgs-fmt + python ]; }; } From 5a83982b30797e9ace57644056b1511e5ccf2e26 Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:29:13 -0400 Subject: [PATCH 09/11] Add `checkout` action --- .github/actions/checkout/action.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/actions/checkout/action.yml diff --git a/.github/actions/checkout/action.yml b/.github/actions/checkout/action.yml new file mode 100644 index 0000000..5d79bac --- /dev/null +++ b/.github/actions/checkout/action.yml @@ -0,0 +1,21 @@ +--- + +name: checkout ember + +runs: + using: composite + + steps: + - uses: actions/cache@v3.3.2 + with: + key: dependencies + path: | + .venv + + - uses: DeterminateSystems/nix-installer-action@v6 + + - uses: DeterminateSystems/magic-nix-cache-action@v2 + + - uses: HatsuneMiku3939/direnv-action@v1.0.2 + with: + direnvVersion: 2.32.3 From 49c47b222553de5b6ca75712c8b0498d6bc0b7ef Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:29:28 -0400 Subject: [PATCH 10/11] Add `pre-commit` workflow --- .github/workflows/pre-commit.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..f265912 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,23 @@ +--- + +name: pre-commit + +# yamllint disable-line rule:truthy +on: + - pull_request + - push + +jobs: + pre-commit: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout `ember` + uses: ./.github/actions/checkout + + - name: Run `pre-commit` hooks + run: pre-commit run --show-diff-on-failure --color=always From 31406aaee121efd11bcbcccd5ee9e5b6c294af1a Mon Sep 17 00:00:00 2001 From: Jacob Koziej Date: Thu, 2 Nov 2023 20:31:10 -0400 Subject: [PATCH 11/11] Remove trailing `/` --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a861b13..e9c5ab7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: hooks: - id: nixpkgs-fmt - - repo: https://github.com/lyz-code/yamlfix/ + - repo: https://github.com/lyz-code/yamlfix rev: 1.13.0 hooks: - id: yamlfix