Commit Graph
189 Commits
Author SHA1 Message Date
vladmalynych 6bbf2a653c Fix linter 'line too long' 2019-07-28 12:28:56 +02:00
vladmalynych 48f52d53e2 Update Readme to more common 2019-07-28 12:28:56 +02:00
Vladyslav Malynych 8eede82a38 Exclude not critical test (#2)
* Exclude not critical test

* Add exclude-tests option

* Update documentation

* Clean forgotten print

* Improve Readme, with examples
2019-07-28 12:28:56 +02:00
David Wobrock e93d4ec4c7 Bump to version 1.2.0 and update CHANGELOG.md 2019-07-10 10:26:42 +02:00
Victor Seva c0d33dd579 support setting DJANGO_PROJECT_FOLDER via --project-root-path
settings file can be located in a subdirectory of the project
2019-07-10 10:20:14 +02:00
David Wobrock 83850fa3da Update README: document 'applied-migrations' and 'unapplied-migrations' options 2019-06-06 22:54:08 +02:00
David Wobrock 5561a308a3 Add tests for ignore applied/unapplied migrations 2019-06-06 22:54:08 +02:00
David Wobrock 19fe5b75fe Add logic to ignore applied or unapplied migrations 2019-06-06 22:54:08 +02:00
David Wobrock ba0704ef3a Always load migrations from database:
This enables us to detect if a migration has been applied to a certain database.
No matter if the migrations and detected from git or all, we always match them with the migrations found by Django.
2019-06-06 22:54:08 +02:00
David Wobrock 3273f1bdc4 Add exclusive options for linting only applied or unapplied migrations 2019-06-06 22:54:08 +02:00
David Wobrock b17c872996 Update README: consistent command line options and remove obsolete option 2019-06-06 22:54:08 +02:00
David Wobrock 42a83f18a0 Bump version to 1.1.0 and add note in CHANGELOG 2019-05-19 22:51:54 +02:00
David Wobrock 9d5f16c0b1 Update README: add note on how I usually publish the package 2019-05-19 22:51:53 +02:00
David Wobrock e948a93399 Update README: remove the code-block for the Operation SQL 2019-05-19 22:42:43 +02:00
David Wobrock e23e46e3d4 IgnoreMigrationOp: add class comment to explain purpose of no-op 2019-05-19 22:32:41 +02:00
David Wobrock e7b3361984 Nitpick: rename function back to easier understandable name 2019-05-19 22:30:51 +02:00
Tobias Krönke dcaa52a4da simplify IgnoreMigration operation 2019-05-19 22:29:02 +02:00
Tobias Kroenke 758468cbb8 hopefully correctly test new ignoring mechanism 2019-05-19 22:29:02 +02:00
Tobias Kroenke 08e15b84ae satisfy black 2019-05-19 22:29:02 +02:00
Tobias Kroenke 48cba37764 remove migration ignore sql analysis 2019-05-19 22:29:02 +02:00
Tobias Krönke 12d0b7e9be obey max line length 2019-05-19 22:29:02 +02:00
Tobias Krönke 44a0c83897 simplify any statement 2019-05-19 22:29:02 +02:00
Tobias Krönke 859b4b3b1b fix tests 2019-05-19 22:29:02 +02:00
Tobias Krönke 3f5b7bdb9b make should_ignore_migration check for IgnoreMigration operation 2019-05-19 22:29:02 +02:00
David Wobrock 60eab0aba3 Add author_email (my own (David Wobrock) for now) and fix an error in the readme rst 2019-05-12 15:57:49 +02:00
David Wobrock 3b2b2f91c2 Clean up unused code and comments 2019-05-12 15:50:03 +02:00
David Wobrock f51daab1c2 Update README.rst
Make code-block appear in GitHub (because of missing space)
2019-05-12 15:40:30 +02:00
David Wobrock a5f83837d1 Add support for Django 2.2 (by testing it in the CI) 2019-05-12 15:32:57 +02:00
David Wobrock c4e6251b53 Update CHANGELOG.md
* add fixed bugs for coming 1.0.0*
* fix some typo and 'styling'
2019-05-12 15:32:57 +02:00
David Wobrock 0f1030d43a Add non-regression test:
Tests that running the linter a second time by ignoring an erroneous migration
will not hit the cache for the said migration.
Instead, it is correctly ignored.
2019-05-12 15:32:57 +02:00
Felix 08dc26085b First check ignores then check cache
This gives you the possibility to add a errornous migration
to the ignore list. On the seccond run the linter will
first use the ignore list and not the cache first.
2019-05-12 15:32:57 +02:00
Felix b7c3ee38d7 Use logger.debug() for lowlevel information
Effectivly this will prevent printing those lines
in a lot of default setups. Those lines make it quite
hard to understand the output of the liter.
2019-05-12 15:32:57 +02:00
Felix 0bf7d5cc39 Use relative imports for easier in-place testing 2019-05-12 15:32:57 +02:00
David Wobrock 42d43fd6aa Update README and add CHANGELOG file 2019-05-12 15:32:57 +02:00
David Wobrock e45e031820 Bump to 1.0.0 and update setup.py to drop command line usage 2019-05-12 15:32:57 +02:00
David Wobrock 5390fd507f Update Tests:
* don't use the project fixtures anymore but the one Django project
* update and refactor cache tests to be less brittle
* explicitly test mysql, postgresql and sqlite3 databases
* remove 'multiple_call' tests since it is not possible anymore
(with the Django singleton)
* update Travis and tox (dropping Python 3.4)
2019-05-12 15:32:57 +02:00
David Wobrock f35c9177f4 Delete examples folder since it is not relevant anymore 2019-05-12 15:32:57 +02: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 0eb584889a Add Django management command to launch the linter 2019-05-12 15:32:57 +02:00
David Wobrock f05a986973 Update .gitignore: remove fixture and add some stuff 2019-05-12 15:32:57 +02:00
David Wobrock 26ed4ecf62 Tests: add test project
* manage.py file at the root of the project
* targetting the project located at tests/test_project/settings.py

That allows testing the linter through just calling it on the project itself.
Using the new method coming soon: `python manage.py lintmigrations`
2019-05-12 15:32:57 +02:00
David Wobrock fdd6b9b06a Tests: Delete all fixture Django projects
We won't need all these different django projects to test the linter.
That adds up to much complexity to the tests.
2019-05-12 15:32:57 +02:00
David Wobrock 64c54b72d4 Bump to version 0.1.5 2019-04-21 12:53:13 +02:00
Taras Vozniuk fb0d7f07bc quite migration name to avoid failures of migration with space in the name 2019-04-21 12:47:17 +02:00
David-Wobrock 1245e7939d Bump to version 0.1.4 2019-02-24 18:19:49 +01:00
David-Wobrock 36e7dfaa0e Do not create cache folder if no-cache option 2019-02-24 18:18:45 +01:00
David-Wobrock c3c1af113c Handle postgresql alter column type
ALTER TABLE table ALTER COLUMN column TYPE
2019-02-24 15:55:05 +01:00
David-Wobrock 999ee2fa5e unrelated: fix some warnings and redundant elements 2019-02-24 15:55:05 +01:00
David-Wobrock 5c7dab8db2 Update linter tests for multiple backends
Create a base test class and have 3 different backends for now:
* mysql
* sqlite3
* postgresql
2019-02-24 15:55:05 +01:00
David-Wobrock ba83526339 Fix caching tests issues on Windows 2019-02-24 15:55:05 +01:00