From b63d1219a05cba3efdc7fd515c9671751ba5f27e Mon Sep 17 00:00:00 2001 From: josiah Date: Thu, 22 Jul 2021 19:59:24 -0500 Subject: [PATCH] Create supporting cast. --- .pre-commit-config.yaml | 24 ++++++++++++++++---- Pipfile | 2 ++ Pipfile.lock | 50 +++++++++++++++++++++++++++++++++++++++-- README.md | 14 ++++++++---- examples/org.org | 4 ++++ pyproject.toml | 11 ++++++++- 6 files changed, 94 insertions(+), 11 deletions(-) create mode 100644 examples/org.org diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b16915a..e514aec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,11 +4,27 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-added-large-files + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files - repo: https://gitlab.com/pycqa/flake8 rev: 3.8.3 hooks: - id: flake8 +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.782 + hooks: + - id: mypy +- repo: https://github.com/psf/black + rev: 20.8b1 + hooks: + - id: black + name: black + description: "Black: The uncompromising Python code formatter" + entry: black + language: python + language_version: python3 + minimum_pre_commit_version: 2.9.2 + require_serial: true + types_or: [python, pyi] diff --git a/Pipfile b/Pipfile index 19c7c0e..c5c35e2 100644 --- a/Pipfile +++ b/Pipfile @@ -4,11 +4,13 @@ verify_ssl = true name = "pypi" [packages] +orgparse = "*" [dev-packages] pre-commit = "*" flake8 = "*" black = "*" +mypy = "*" [requires] python_version = "3.9" diff --git a/Pipfile.lock b/Pipfile.lock index c6f0df1..e51e98d 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "4219012ac68995cbc5685108c5d82240645f25ea3fc022ec7380236068016ec3" + "sha256": "233f427973f10bd15d587842663576f3fbaf215ae9436ff05133b7d44e0ed907" }, "pipfile-spec": 6, "requires": { @@ -15,7 +15,16 @@ } ] }, - "default": {}, + "default": { + "orgparse": { + "hashes": [ + "sha256:5b6c3012cf459b0201d42f58dd02da96beeed0913f64080f150b2666655b4d74", + "sha256:5f3ef34198b7adc0f392808742e65779285896dd3de1ffb0aa20b751b9fc6e60" + ], + "index": "pypi", + "version": "==0.2.4" + } + }, "develop": { "appdirs": { "hashes": [ @@ -93,6 +102,35 @@ ], "version": "==0.6.1" }, + "mypy": { + "hashes": [ + "sha256:088cd9c7904b4ad80bec811053272986611b84221835e079be5bcad029e79dd9", + "sha256:0aadfb2d3935988ec3815952e44058a3100499f5be5b28c34ac9d79f002a4a9a", + "sha256:119bed3832d961f3a880787bf621634ba042cb8dc850a7429f643508eeac97b9", + "sha256:1a85e280d4d217150ce8cb1a6dddffd14e753a4e0c3cf90baabb32cefa41b59e", + "sha256:3c4b8ca36877fc75339253721f69603a9c7fdb5d4d5a95a1a1b899d8b86a4de2", + "sha256:3e382b29f8e0ccf19a2df2b29a167591245df90c0b5a2542249873b5c1d78212", + "sha256:42c266ced41b65ed40a282c575705325fa7991af370036d3f134518336636f5b", + "sha256:53fd2eb27a8ee2892614370896956af2ff61254c275aaee4c230ae771cadd885", + "sha256:704098302473cb31a218f1775a873b376b30b4c18229421e9e9dc8916fd16150", + "sha256:7df1ead20c81371ccd6091fa3e2878559b5c4d4caadaf1a484cf88d93ca06703", + "sha256:866c41f28cee548475f146aa4d39a51cf3b6a84246969f3759cb3e9c742fc072", + "sha256:a155d80ea6cee511a3694b108c4494a39f42de11ee4e61e72bc424c490e46457", + "sha256:adaeee09bfde366d2c13fe6093a7df5df83c9a2ba98638c7d76b010694db760e", + "sha256:b6fb13123aeef4a3abbcfd7e71773ff3ff1526a7d3dc538f3929a49b42be03f0", + "sha256:b94e4b785e304a04ea0828759172a15add27088520dc7e49ceade7834275bedb", + "sha256:c0df2d30ed496a08de5daed2a9ea807d07c21ae0ab23acf541ab88c24b26ab97", + "sha256:c6c2602dffb74867498f86e6129fd52a2770c48b7cd3ece77ada4fa38f94eba8", + "sha256:ceb6e0a6e27fb364fb3853389607cf7eb3a126ad335790fa1e14ed02fba50811", + "sha256:d9dd839eb0dc1bbe866a288ba3c1afc33a202015d2ad83b31e875b5905a079b6", + "sha256:e4dab234478e3bd3ce83bac4193b2ecd9cf94e720ddd95ce69840273bf44f6de", + "sha256:ec4e0cd079db280b6bdabdc807047ff3e199f334050db5cbb91ba3e959a67504", + "sha256:ecd2c3fe726758037234c93df7e98deb257fd15c24c9180dacf1ef829da5f921", + "sha256:ef565033fa5a958e62796867b1df10c40263ea9ded87164d67572834e57a174d" + ], + "index": "pypi", + "version": "==0.910" + }, "mypy-extensions": { "hashes": [ "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d", @@ -251,6 +289,14 @@ "markers": "python_version >= '3.6'", "version": "==1.0.4" }, + "typing-extensions": { + "hashes": [ + "sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958f7e56fcc31b497", + "sha256:50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342", + "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84" + ], + "version": "==3.10.0.0" + }, "virtualenv": { "hashes": [ "sha256:51df5d8a2fad5d1b13e088ff38a433475768ff61f202356bb9812c454c20ae45", diff --git a/README.md b/README.md index b159e1c..e116aa3 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,12 @@ Matrix Orgmode ListenER. # TODOs - [ ] setup all of this stuff - - [ ] Precommit (for all your commithook needs) + - [X] Precommit (for all your commithook needs) - On initial setup you likely want to run a new config against all files: `pre-commit run --all-files` - - [ ] Black + commithooks; feel free to tweak line settings + - [X] Black + commithooks; feel free to tweak line settings - Black is still technically pre-release; install like `pipenv install -d black --pre` - - [ ] Mypy + commithooks - - [ ] Pylint / Flake8; feel free to tweak line settings + - [X] Mypy + commithooks + - [X] Pylint / Flake8; feel free to tweak line settings - [X] Pipenv (bluh. I guess this is what work is using, so, fine.) - append installs with `-d` to add them as a dev dependency @@ -35,3 +35,9 @@ Matrix Orgmode ListenER. - [X] Python versions with pyenv - This is pretty easy, though its a very stupid curl | bash. Fuckers. - Also some annoying prereqs that you need to be careful about; some Mac specific fuckery. + +# Editor bullshit +- [ ] Get LSPs shit working with my new setup: + - auto detect pyvenv + - resolve imports + - etc diff --git a/examples/org.org b/examples/org.org new file mode 100644 index 0000000..843f408 --- /dev/null +++ b/examples/org.org @@ -0,0 +1,4 @@ +* my first tree + DEADLINE: <2021-07-22 Thu> + some plain text + ~formatted text~ diff --git a/pyproject.toml b/pyproject.toml index 5e4d7f9..1badc36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] line-length = 88 -target-version = ['py38'] +target-version = ['py39'] include = '\.pyi?$' exclude = ''' @@ -21,3 +21,12 @@ exclude = ''' # the root of the project ) ''' +[tool.mypy] +python_version = "3.8" +warn_return_any = true +warn_unused_configs = true + +# mypy per-module options: + +[[tool.mypy.overrides]] +ignore_missing_imports = true