From 776fc3839568ea1f4c0945e0107bd05331d8244f Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Mon, 4 Apr 2022 12:01:35 -0400 Subject: [PATCH 1/3] Set black line length to 100 --- pyproject.toml | 3 +++ tests/README.md | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..468dbfa --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[tool.black] +line-length = 100 +target-version = ['py37', 'py38', 'py39', 'py310'] diff --git a/tests/README.md b/tests/README.md index 53bb4a9..ff22713 100644 --- a/tests/README.md +++ b/tests/README.md @@ -16,7 +16,7 @@ Environments for this repository are configured in [`tox.ini`] as described belo The `lint` environment ensures that the code meets basic coding standards, including -- [_Black_] formatting style +- [_Black_] formatting style, as configured by [`pyproject.toml`] - [mypy] type annotation checker, as configured by [`mypy.ini`] - [pylint], as configured by [`.pylintrc`] @@ -63,6 +63,7 @@ $ tox -ecoverage [`mypy.ini`]: /mypy.ini [treon]: https://github.com/ReviewNB/treon [_Black_]: https://github.com/psf/black +[`pyproject.toml`]: /pyproject.toml [pylint]: https://github.com/PyCQA/pylint [`.pylintrc`]: /.pylintrc [nbqa]: https://github.com/nbQA-dev/nbQA From 941a5f4afb7d59203e785cda6f0298844cf954ee Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Mon, 4 Apr 2022 12:08:59 -0400 Subject: [PATCH 2/3] Actually run black with the new line length --- prototype_template/template_module/template_class.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/prototype_template/template_module/template_class.py b/prototype_template/template_module/template_class.py index 1cc3132..e047010 100644 --- a/prototype_template/template_module/template_class.py +++ b/prototype_template/template_module/template_class.py @@ -8,9 +8,7 @@ class TemplateClass: def __init__( self, - some_parameter: Union[ - int, float, str, bool, List[Union[int, float, str, bool]] - ], + some_parameter: Union[int, float, str, bool, List[Union[int, float, str, bool]]], optional_parameter: Optional[ Union[int, float, str, bool, List[Union[int, float, str, bool]]] ] = None, From 515d55ce569d87da4e9882f44a93685fc3cb4b72 Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Tue, 12 Apr 2022 07:12:31 -0400 Subject: [PATCH 3/3] Revert "Update CONTRIBUTING with default black line length (#45)" This reverts commit 8b08a629b83a09adfbd1f35885aa9f1df0c4c72e. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa773af..142b9e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ Users are encouraged to use GitHub Discussions for engaging with researchers, de ### Project Code Style -Code in this repository should conform to PEP8 standards. Style/lint checks are run to validate this. Line length must be limited to no more than 88 characters. +Code in this repository should conform to PEP8 standards. Style/lint checks are run to validate this. Line length must be limited to no more than 100 characters. ### Pull Request Checklist