Commit Graph
100 Commits
Author SHA1 Message Date
David Wobrock 43dc2dcabd Lock lint dependencies 2019-07-28 12:28:56 +02:00
David Wobrock 7215afa4a4 Fix line too long (flake8) 2019-07-28 12:28:56 +02:00
David Wobrock 85b9abdbc3 Display information that a problem has been found but ignored (and therefore the migration is considered ok) 2019-07-28 12:28:56 +02:00
David Wobrock aa8043db74 Add unit test for exclude migration tests 2019-07-28 12:28:56 +02:00
David Wobrock af4b11c563 Document (README & CHANGELOG) and rename option to 'exclude-migration-tests' 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
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
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
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
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
David-Wobrock f5a587c2be Fix split path function
So it also works on windows
and does not return empty stuff
and update tests
2019-02-24 15:55:05 +01:00
David-Wobrock c403754564 Add blog post to readme
The article written by Felix about the linter and handling backward
incompatible migrations in Django
2019-02-24 15:55:05 +01:00
David-Wobrock f8d9ab777a Do not manually retrieve python interpreter path
Instead of doing custom and wrong path detection, just
use sys.executable which does exactly that
2019-02-24 11:04:21 +01:00
David-Wobrock 3591a4422a Bump to version 0.1.3 2019-02-03 19:39:31 +01:00
David Wobrock d22401f101 Add tests for version option
From Python 3.4 on, version is printed on stdout instead
of stderr.
2019-02-03 19:38:38 +01:00
David Wobrock fea623630e Add --version option 2019-02-03 19:38:38 +01:00
David Wobrock 4d68f7bac8 Bump version to 0.1.2 2019-01-21 22:08:57 +01:00
David Wobrock 4c5d12800e Add in the readme what is looked for by the linter 2019-01-21 22:03:17 +01:00
David Wobrock 1a9024e799 add test for git on non root location 2019-01-20 12:17:11 +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
David Wobrock 75c969c6a9 Revert "don't assume git root is django_path"
This reverts commit c14f9aef37.
2019-01-20 11:46:30 +01:00
David-Wobrock f52bb3d9b8 Bump version to 0.1.1 2019-01-07 19:37:51 +01:00
David-Wobrock 7a34ac9010 Fix tests and git migration gathering 2019-01-05 17:39:09 +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 f0021dc139 Add test migration in folder 2019-01-04 22:00:19 +01:00
David-Wobrock 574af4b7fe Do not check if .git folder exists
git commands will fail anyway if not present
2019-01-04 21:42:39 +01:00
David-Wobrock 99534e4eb9 Bump version to 0.1.0 and set to dev status Beta 2019-01-03 22:13:37 +01:00
David-Wobrock 952e596d92 Bump copyright version to 2019 in files 2019-01-03 22:05:00 +01:00
David-Wobrock 1e2068eed5 Add black to lint tests and increase line length for flake8 2018-12-30 11:56:21 +01:00
David-Wobrock f05b199925 Black all files 2018-12-30 11:56:21 +01:00
David-Wobrock 03bd7753e5 Change ubuntu dist to xenial 2018-12-30 11:56:03 +01:00
David-Wobrock d041f7dbf7 Add django 2.1 to tested envs 2018-12-30 11:56:03 +01:00
David-Wobrock ef23a622ca Add python 3.7 to tests 2018-12-30 11:56:03 +01:00
David Wobrock 6eaae00d86 Merge pull request #26 from 3YOURMIND/cache
#23 - Cache
2018-12-24 15:56:28 +01:00
David-Wobrock 95274b9a67 Update Readme for new linter ignore migration operation
Use master for PRs. No need for a dev branch
2018-12-23 17:46:57 +01:00
David-Wobrock fe6433a065 Use a custom migration operation instead of a RunSQL statement 2018-12-23 17:46:57 +01:00
David-Wobrock 395379178b Fix linting through using a raw python string 2018-12-23 12:25:41 +01:00
David-Wobrock 178d8036c2 Bump to version 0.0.7 2018-09-06 21:48:52 +02:00
David-Wobrock c26bd2b628 Provide a default value to next() function in case of empty errors array 2018-09-06 21:47:28 +02:00
David-Wobrock 6174c76c36 Bump to version 0.0.6 2018-07-19 22:14:25 +02:00
David-Wobrock d672f06635 Drop django 1.10 support (and fix some PEP8) 2018-07-19 22:14:13 +02:00
David-Wobrock 555d17adcd Rename log object to logger (to follow the standard) 2018-07-19 22:03:37 +02:00
David-Wobrock 7364455073 Add test to assert that a not null FK on a new table is accepted 2018-05-07 20:36:20 +02:00
David-Wobrock f692a39030 Add sentence about example integration in readme 2018-01-20 16:24:31 +01:00
David-Wobrock 7a69d36393 Bump version to 0.0.5 2018-01-20 16:20:09 +01:00
David-Wobrock 416a102186 Merge branch 'dev' 2018-01-20 16:19:32 +01:00
David-Wobrock 6add9fefbf Merge branch 'add-example-to-readme' into dev 2018-01-20 16:15:27 +01:00
David-Wobrock eebbcc4cc0 Fix PEP8 requirement 2018-01-20 16:10:41 +01:00
David-Wobrock 07de522fce Remove git samples 2018-01-20 16:02:58 +01:00
David-Wobrock 3037585cc2 Fix #9 - add information message when altering columns - may be backward compatible 2018-01-20 15:59:38 +01:00
David Wobrock cbbcdc2e2c Merge pull request #14 from 3YOURMIND/only-consider-added-migrations
Only consider added migrations
2018-01-20 15:57:42 +01:00
David-Wobrock 698e658faa Fix test : do not consider deleted migrations
* Change way to detect deleted migrations (diff-filter of 'git diff' command)
2018-01-20 15:50:45 +01:00
David-Wobrock fffdf5714e Fix that linter actually ignores deleted files and add a specific test for this 2018-01-18 23:56:33 +01:00
David Wobrock ced0b8c3ef Merge pull request #13 from 3YOURMIND/create-readme-rst
Fix #11 - Change readme to reStructuredText
2018-01-17 18:02:16 +01:00
David Wobrock 3e27f117ba Migrate the complete readme to reStructuredText 2018-01-17 17:41:24 +01:00
David-Wobrock e4880c5600 Consider altering a column as backward incompatible
* Resolves #9
* With test
* For mysql only currently
2018-01-14 15:52:46 +01:00
David-Wobrock 7007e788be Add django as a requirement to the linter
Obviously it is needed when generating the sql through the sqlmigrate command
2018-01-14 13:51:01 +01:00
David-Wobrock 3ad331f644 Bump version 2018-01-13 00:48:42 +01:00
David-Wobrock 5f078506a4 Merge branch 'dev' 2018-01-13 00:48:07 +01:00
David-Wobrock b24315c1d9 Add contributing section to README 2018-01-13 00:47:29 +01:00
David Wobrock 69f5846890 Merge pull request #10 from 3YOURMIND/small-improvements
Improve Error Reporting
2018-01-13 00:47:13 +01:00
David-Wobrock 306551234a Fix import errors for python3 & print error message on stderr (through exception message) 2018-01-13 00:40:03 +01:00
David-Wobrock 61cd48dc8c Merge branch 'dev' into small-improvements 2018-01-13 00:11:53 +01:00
David Wobrock 388f4e565c Merge pull request #8 from 3YOURMIND/better-description-for-pypi
Use pypandoc to convert markdown to pypi friendly format
2018-01-13 00:09:45 +01:00
David-Wobrock 8da1466f8d Merge branch 'dev' into better-description-for-pypi 2018-01-12 23:55:52 +01:00
David-Wobrock 317156bf2b Remove django 1.9 support and fix PEP8 2018-01-12 23:23:11 +01:00
David-Wobrock dcbcb0883c Use python exe in current venv 2018-01-12 23:01:11 +01:00
David-Wobrock 8adffed958 Call venv linter in tests 2018-01-07 17:34:08 +01:00
David-Wobrock d1d296b826 Add manifest for tox tests on travis 2018-01-07 12:44:59 +01:00
David-Wobrock 55e1e13ad5 Update copyright year to 2018 2018-01-07 12:15:23 +01:00
David-Wobrock ad3b17229c Add tox to test different python and django versions 2018-01-07 12:09:07 +01:00