]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Make 'python -m black' work (#1460)
authorRichard Si <63936253+ichard26@users.noreply.github.com>
Wed, 27 May 2020 02:42:07 +0000 (22:42 -0400)
committerGitHub <noreply@github.com>
Wed, 27 May 2020 02:42:07 +0000 (19:42 -0700)
README.md
src/black/__main__.py [new file with mode: 0644]

index 80ef534213df634d43f75a12ffdb4015c72d4d48..b06c93723d38ca65dce46d347a1b80119fd27bf5 100644 (file)
--- a/README.md
+++ b/README.md
@@ -58,6 +58,12 @@ To get started right away with sensible defaults:
 black {source_file_or_directory}
 ```
 
+You can run _Black_ as a package if running it as a script doesn't work:
+
+```sh
+python -m black {source_file_or_directory}
+```
+
 ### Command line options
 
 _Black_ doesn't provide many options. You can list them by running `black --help`:
diff --git a/src/black/__main__.py b/src/black/__main__.py
new file mode 100644 (file)
index 0000000..19b810b
--- /dev/null
@@ -0,0 +1,3 @@
+from black import patched_main
+
+patched_main()