David Wobrock
2ee7dac3b3
Add internal classes and add type hints + mypy.
2022-12-26 16:26:24 +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
David Wobrock
813c5c8690
Remove apache license headers in each file. The one full copy of the license at the root of the repo shall define the license for all source files.
2020-01-11 22:08:33 +01:00
David Wobrock
484a775fda
Linter Core: change lots of behaviour
...
* Use the Django migration classes to manipulate these objects
this includes the discovery of migrations through the MigrationLoader
(instead of manually walking through the Django project and find the migrations through a regex)
and representing a Migration through the Django class.
* Get the SQL of a migration through a 'call_command' call of 'sqlmigrate'
That speeds up greatly the linter since we don't have to setup Django for each migration
* Add the database to the cache path
2019-05-12 15:32:57 +02:00
David-Wobrock
36e7dfaa0e
Do not create cache folder if no-cache option
2019-02-24 18:18:45 +01:00
David-Wobrock
999ee2fa5e
unrelated: fix some warnings and redundant elements
2019-02-24 15:55:05 +01:00
David Wobrock
009153fbf4
handle linting a project in pwd
...
When calling "django-migration-linter ."
be able to handle it (especially with cache)
2019-01-20 12:17:11 +01:00
Felix
92a686f13b
Make imports relative
2019-01-05 22:24:33 +01:00
David-Wobrock
c6df7e53a0
Add Migration class to hold the path, app name and migration name in one object + adapt existing logic
2019-01-05 16:59:36 +01:00
David-Wobrock
952e596d92
Bump copyright version to 2019 in files
2019-01-03 22:05:00 +01:00
David-Wobrock
f05b199925
Black all files
2018-12-30 11:56:21 +01:00
Felix
5be5e3f769
Use call_count instead of assert_called()
...
because later was introduced in python 3.6.
2018-12-23 23:46:33 +01:00
Felix
1c28412ebd
Improve the cache
...
React to Comments and add a Test
2018-12-23 23:28:45 +01:00
Felix
d3805d5210
Integrate IGNORE into cache
2018-12-23 22:49:36 +01:00
Felix
f351b71d6a
Fix flake8
2018-12-20 14:53:25 +01:00
Felix
b68c0183bb
Finish up cache and fix tests.
...
Still TODO: Merge with ignore functionality.
2018-12-20 14:45:35 +01:00