David Wobrock
2ee7dac3b3
Add internal classes and add type hints + mypy.
2022-12-26 16:26:24 +01:00
Nikita Karamov
cb8492d8a7
Use a context manager to write to /dev/null
2022-11-14 09:01:21 +01:00
David Wobrock
e8f83708b0
Run black.
2022-11-03 22:00:00 +01:00
Sondre Lillebø Gundersen
a9405eaf83
feat: Support Path type for project_root_path
...
Django has switched to using pathlib.Path in startproject. This adds support for these in the project root path config option.
2022-11-03 22:00:00 +01:00
Sondre Lillebø Gundersen
bd4eb89b8c
chore: Upgrade Python syntax with pyupgrade
...
Run with the following pre-commit configuration:
```
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
hooks:
- id: pyupgrade
args: [ "--py3-plus", "--py36-plus", "--py37-plus" ]
```
The rationale for every change can be found at https://github.com/asottile/pyupgrade
2022-11-03 22:00:00 +01:00
Sören Wegener
a3fc5f1a50
Improve error message when an unsupported database vendor/SQL analyser was selected.
2022-10-03 15:48:11 +02:00
Tobias Krönke
d1c1388f28
feat(IgnoreMigration): elidable by default to support squashing
2022-10-03 15:47:49 +02:00
David Wobrock
6ba29a6b5d
Fix flake8 linting.
2022-08-07 17:06:10 +02:00
David Wobrock
bef47906d1
Fix #209 - Raise when getting SQL statements fail.
2022-07-28 23:45:14 +02:00
David Wobrock
74a7ee9239
Remove remaining __future__ imports.
2022-07-23 11:59:50 +02:00
David Wobrock
f67f27354d
Fix #218 - Handle model 'objects' call with other parts in the name.
2022-07-09 15:37:57 +02:00
David Wobrock
ea227eb364
Bump to 4.1.0
2022-04-24 18:00:55 +02:00
Phillip Verheyden
88a7b0812a
Allow project_root_path and verbosity to come from Django settings
...
And still fallback to DJANGO_SETTINGS_MODULE environ for project_root_path if not explicitly set
Fixes #203
2022-03-19 20:12:03 +01:00
David Wobrock
c2ad3e6aeb
Allow passing '--sql-analyser' to makemigrations command
2022-03-13 17:54:04 +01:00
David Wobrock
c7d9129db9
Adapt 'warnings-as-errors' option to allow taking migration test codes as input
2022-03-13 17:26:40 +01:00
David Wobrock
5f11f9417f
Refactor logging configuration to both Django management commands lintmigrations and makemigrations
2022-03-13 16:51:29 +01:00
David Wobrock
8e56562771
Bump to 4.0.0
2022-02-20 12:26:31 +01:00
David Wobrock
4fa6a33153
Fix #198 -- Allow using Django settings for linter configuration
2022-02-15 19:21:58 +01:00
David Wobrock
76a55dbb12
Raise when unsupported db vendor, and add option to specify SQL analyser
2022-01-30 15:20:18 +01:00
David Wobrock
85189b7c1d
Refactor config and toml files read into staticmethods
2022-01-28 21:48:05 +01:00
David Wobrock
5a6ddd0d63
Allow overriding any option through config file, and not only a subset
2022-01-28 21:48:05 +01:00
David Wobrock
3219f9cf8a
Handle creating a unique index as adding a unique constraint
2022-01-28 21:23:44 +01:00
David Wobrock
7674a51bc9
Fix #178 -- Don't detect an index creation when the table is being created
2021-12-20 22:38:54 +01:00
David Wobrock
085048d22b
Drop Py2.7, 3.5 and Django 1.11, 2.0, 2.1, 3.0
2021-11-12 17:26:38 +01:00
Daniel Hahler
5a969b578e
build(deps): drop six from requirements
...
It is only used in a single place to check for Python 2, which can
easily be inlined.
2021-09-13 23:04:37 +02:00
David Wobrock
fce21b71e9
Bump to 3.0.1 and update changelog
2021-08-14 15:26:04 +02:00
Christian Bundy
397c1f0e16
Default ends_with_default to False
...
Problem: Previously in gh-117 we aimed to solve gh-115, which described a problem where we used `SET DEFAULT` and then `DROP DEFAULT` immediately afterward. The solution was to track whether any defaults are retained, but the `ends_with_default` variable is initialized as `None` rather than `False`. At the end of the function we check whether `ends_with_default is False`, never occurs unless a default is set.
Solution: Assume that there is no default unless proven otherwise, and iniitializie `ends_with_default` to `False` instead of `None`.
Fixes: gh-158
2021-08-14 15:22:24 +02:00
David Wobrock
3f0531f349
Bump to 3.0.0
2021-06-26 16:02:38 +02:00
David Wobrock
419f90e728
Fix #119 -- Handle verbosity=0 level correctly and suppress all prints/logs
2021-06-26 13:29:01 +02:00
David Wobrock
fa56196f04
Add PG reindex linting warning and improve some smaller stuff
2021-06-19 18:15:40 +02:00
David Wobrock
6e15f65467
Fix typo in warning variable
2021-06-19 18:15:40 +02:00
David Wobrock
27e492996c
Apply black
2021-06-19 18:15:40 +02:00
David Wobrock
2bf87c0659
Add Postgresql warning when using DROP INDEX without CONCURRENTLY keyword
2021-06-19 18:15:40 +02:00
David Wobrock
70db245df3
Adapt migration linter to handled returned warnings
2021-06-19 18:15:40 +02:00
David Wobrock
343d163c88
Add Postgresql warning when using CREATE INDEX without CONCURRENTLY keyword
2021-06-19 18:15:40 +02:00
David Wobrock
9ea8872a29
Add warnings type to SQL analyser
2021-06-19 18:15:40 +02:00
David Wobrock
6d595f1555
Add support for positional app_label and migration_name arguments
2021-05-26 18:53:19 +02:00
David Wobrock
bf525ae79d
Make git commit id a named CLI parameter
2021-05-26 18:53:19 +02:00
91e0147f9b
load config from pyproject.toml ( #143 )
...
* load-toml
* move toml to extras_require
* fix linter, add hint
* Update toml PR
- always install toml deps, we can add it to all installs
- don't override the command line config values with the ones from the config files
- handle getboolean again for configparser
- be able to have both a toml and another config file, and both configs are taken into account
* Add changelog message for later
Co-authored-by: aakrivonos <aakrivonos@domclick.ru >
Co-authored-by: David-Wobrock <david.wobrock@gmail.com >
2021-05-25 23:20:07 +02:00
David-Wobrock
b2f4c634b5
Bump to 2.5.3
2021-04-12 18:58:02 +02:00
David-Wobrock
aec14ccd53
Bump to 2.5.2
2021-04-01 23:11:35 +02:00
David-Wobrock
2f3ce1d7cc
Remove toml support
2021-04-01 23:11:35 +02:00
David-Wobrock
b16081fecf
Fix linting
2021-02-04 22:00:59 +01:00
David Wobrock
1586a3f607
Bump to 2.5.1
2021-02-04 19:30:09 +01:00
David Wobrock
48f199a91b
Use utf-8 encoding on config files
2021-02-04 19:28:09 +01:00
Łukasz Skarżyński
0750ecf593
remove .editorconfig from supported config files
2021-02-04 19:22:57 +01:00
David-Wobrock
bfce31f229
Bump to 2.5.0
2021-01-31 17:51:21 +01:00
David-Wobrock
137089573c
Implement include migration name options
2021-01-31 17:44:58 +01:00
David-Wobrock
1eccbbfc07
Fix configuration file for boolean values
2021-01-17 16:28:31 +01:00
David-Wobrock
2dc4caadf9
Implement config files
2021-01-17 16:28:31 +01:00