From 84aeb8ef31107505af5f0015887b4aafc453a4cf Mon Sep 17 00:00:00 2001 From: Bendik Samseth Date: Fri, 10 Feb 2023 15:36:21 +0100 Subject: [PATCH] =?UTF-8?q?bump:=20version=201.0.5=20=E2=86=92=202.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ README.md | 31 +++++++++++++++++++++---------- blackbricks/__init__.py | 2 +- blackbricks/cli.py | 18 ------------------ pyproject.toml | 4 ++-- 5 files changed, 30 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2023a3..de86fbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 2.0.0 (2023-02-10) + +### BREAKING CHANGE + +- add newline at the end of formatted notebooks (#36) + ## 1.0.5 (2023-02-07) ### Fix diff --git a/README.md b/README.md index af591cf..9164e98 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,6 @@ A formatting tool for your Databricks notebooks. - Python cells are formatted with [black](https://github.com/psf/black) - SQL cells are formatted with [sqlparse](https://github.com/andialbrecht/sqlparse) -## Breaking changes with version 1.0 - -Earlier versions of blackbricks applied a patched version of black in order to allow two-space indentation. This was -done because Databricks used two-space indentation, and did not allow you to change that. - -Since then, Databricks has added the option to choose. Because you can now choose, blackbricks re-joins black in being -uncompromising, and since version 1.0 you can no longer choose anything but 4 space indentation. - -If you _must_ keep using two-space indentation, then stick to versions `<1.0`. - ## Table of Contents * [Installation](#installation) @@ -28,6 +18,7 @@ If you _must_ keep using two-space indentation, then stick to versions `<1.0`. * [Version control integration](#version-control-integration) * [Contributing](#contributing) * [FAQ](#faq) +* [Breaking changes](#breaking-changes) ## Installation @@ -207,3 +198,23 @@ your installation method of choice. ### Shell commands like `!ls` throws an error See https://github.com/inspera/blackbricks/issues/21. + +## Breaking changes + +### Breaking changes with version 2.0 + +Notebooks will be terminated with a `\n` starting with version `2.0.0`. This harmonizes EOF handling and should be much +less annoying in practice than prior versions. This causes a diff on _any_ notebook that was previously formatted with +`blackbricks<2.0.0`. + +Also, the deprecated and non-functional flag for two space indentation is removed, and providing said flag is now an error. + +### Breaking changes with version 1.0 + +Earlier versions of blackbricks applied a patched version of black in order to allow two-space indentation. This was +done because Databricks used two-space indentation, and did not allow you to change that. + +Since then, Databricks has added the option to choose. Because you can now choose, blackbricks re-joins black in being +uncompromising, and since version 1.0 you can no longer choose anything but 4 space indentation. + +If you _must_ keep using two-space indentation, then stick to versions `<1.0`. diff --git a/blackbricks/__init__.py b/blackbricks/__init__.py index 68cdeee..8c0d5d5 100644 --- a/blackbricks/__init__.py +++ b/blackbricks/__init__.py @@ -1 +1 @@ -__version__ = "1.0.5" +__version__ = "2.0.0" diff --git a/blackbricks/cli.py b/blackbricks/cli.py index 778cd83..74a72fc 100644 --- a/blackbricks/cli.py +++ b/blackbricks/cli.py @@ -136,11 +136,6 @@ def main( sql_upper: bool = typer.Option( True, help="SQL keywords should be UPPERCASE or lowercase." ), - no_indent_with_two_spaces: Optional[bool] = typer.Option( - None, - "--no-indent-with-two-spaces", - help="DEPRECATED: Blackbricks now uses 4 spaces for indentation by default. This option will be removed in future versions.", - ), check: bool = typer.Option( False, "--check", @@ -183,19 +178,6 @@ def main( """ assert not version, "If version is set, we don't get here." - if no_indent_with_two_spaces is not None: - warnings.simplefilter("always", DeprecationWarning) - warnings.warn( - textwrap.dedent( - """ - Blackbricks now uses 4 spaces for indentation by default. - Please stop using the `--no-indent-with-two-spaces` option, as it will be removed in future versions. - """ - ), - category=DeprecationWarning, - stacklevel=0, - ) - mutually_exclusive(["--check", "--diff"], [check, diff]) if not filenames: diff --git a/pyproject.toml b/pyproject.toml index c3f4e8e..8a58657 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "blackbricks" -version = "1.0.5" +version = "2.0.0" description = "Black for Databricks notebooks" authors = ["Bendik Samseth "] license = "MIT" @@ -41,7 +41,7 @@ mypy = "^0.971" [tool.commitizen] name = "cz_conventional_commits" -version = "1.0.5" +version = "2.0.0" tag_format = "$version" version_files = [ "blackbricks/__init__.py:version",