3e4b520190f1e4aaced9267bd5dcde59b3d0211f

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

refactor(django)!: deprecate plugin in favor of Zsh's django completion

BREAKING CHANGE: Zsh already provides completion for the `django-admin` and `manage.py`
commands, which is substantially better than the one provided by this plugin. We're
therefore deprecating this plugin and we will remove it in the near future.

Diff

 1diff --git a/plugins/django/README.md b/plugins/django/README.md
 2index 1740e55e56854592820a78b6da00d32bd1c28d4e..cfab43980b97939aa7f2e3aba76119861bbde05c 100644
 3--- a/plugins/django/README.md
 4+++ b/plugins/django/README.md
 5@@ -1,36 +1,12 @@
 6 # Django plugin
 7 
 8-This plugin adds completion and hints for the [Django Project](https://www.djangoproject.com/) `manage.py` commands
 9-and options.
10+This plugin adds completion for the [Django Project](https://www.djangoproject.com/) commands
11+(`manage.py`, `django-admin`, ...).
12 
13-To use it, add `django` to the plugins array in your zshrc file:
14+## Deprecation (2021-09-22)
15 
16-```zsh
17-plugins=(... django)
18-```
19+The plugin used to provide completion for `./manage.py` and `django-admin`, but Zsh already provides
20+a better, more extensive completion for those, so this plugin is no longer needed.
21 
22-## Usage
23-
24-```zsh
25-$> python manage.py (press <TAB> here)
26-```
27-
28-Would result in:
29-
30-```zsh
31-cleanup                    -- remove old data from the database
32-compilemessages            -- compile .po files to .mo for use with gettext
33-createcachetable           -- creates table for SQL cache backend
34-createsuperuser            -- create a superuser
35-dbshell                    -- run command-line client for the current database
36-diffsettings               -- display differences between the current settings and Django defaults
37-dumpdata                   -- output contents of database as a fixture
38-flush                      -- execute 'sqlflush' on the current database
39-inspectdb                  -- output Django model module for tables in database
40-loaddata                   -- install the named fixture(s) in the database
41-makemessages               -- pull out all strings marked for translation
42-reset                      -- executes 'sqlreset' for the given app(s)
43-runfcgi                    -- run this project as a fastcgi
44-runserver                  -- start a lightweight web server for development
45-...
46-```
47+Right now a warning message is shown, but in the near future the plugin will stop working altogether.
48+So you can remove it from your plugins and you'll automatically start using Zsh's django completion.
49diff --git a/plugins/django/django.plugin.zsh b/plugins/django/django.plugin.zsh
50index c2d00c1711ae4c33c78254d36d1edeb8a34f8135..a07a308895aa0b90dc6ce1769de87c517dae5058 100644
51--- a/plugins/django/django.plugin.zsh
52+++ b/plugins/django/django.plugin.zsh
53@@ -402,3 +402,6 @@ compdef _managepy django
54 compdef _managepy django-admin
55 compdef _managepy django-admin.py
56 compdef _managepy django-manage
57+
58+print -P "%F{yellow}The django plugin is deprecated in favor of Zsh's Django completion.
59+%BPlease remove it from your plugins to stop using it.%b%f"