From c86a144f2d28238855967b07baedfe404c5db4aa Mon Sep 17 00:00:00 2001 From: Abdullah Alaqeel Date: Tue, 1 Aug 2023 20:50:24 +0300 Subject: [PATCH] refactor: upgrade the code to django 3.2+ refactor: added pre-commit configs --- .pre-commit-config.yaml | 24 +++++++++++++++++++ CHANGELOG.rst | 2 +- LICENSE | 1 - demo_proj/demo_app/__init__.py | 1 - demo_proj/demo_proj/settings.py | 2 +- setup.py | 5 ---- .../tabular_permissions.js | 2 +- tests/urls.py | 2 -- 8 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3171bb8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/asottile/pyupgrade + rev: v3.10.1 + hooks: + - id: pyupgrade + args: [--py37-plus] + + - repo: https://github.com/adamchainz/django-upgrade + rev: 1.14.0 + hooks: + - id: django-upgrade + args: [--target-version, "3.2"] + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + args: + - --markdown-linebreak-ext=md + - id: mixed-line-ending + - id: check-yaml diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 034768a..92a0d2b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -92,4 +92,4 @@ CHANGELOG Added tests, travis CI 1.0.0 (Dec 9 2015) - initial concept proof \ No newline at end of file + initial concept proof diff --git a/LICENSE b/LICENSE index b101e0e..6554371 100644 --- a/LICENSE +++ b/LICENSE @@ -21,4 +21,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/demo_proj/demo_app/__init__.py b/demo_proj/demo_app/__init__.py index 31ad188..e69de29 100644 --- a/demo_proj/demo_app/__init__.py +++ b/demo_proj/demo_app/__init__.py @@ -1 +0,0 @@ -default_app_config='demo_app.apps.DemoAppConfig' diff --git a/demo_proj/demo_proj/settings.py b/demo_proj/demo_proj/settings.py index 4fe6714..07bd3c1 100644 --- a/demo_proj/demo_proj/settings.py +++ b/demo_proj/demo_proj/settings.py @@ -121,4 +121,4 @@ # https://docs.djangoproject.com/en/1.11/howto/static-files/ STATIC_URL = '/static/' -os.path.join('../') \ No newline at end of file +os.path.join('../') diff --git a/setup.py b/setup.py index 200763a..444bc70 100644 --- a/setup.py +++ b/setup.py @@ -22,11 +22,6 @@ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', - 'Framework :: Django :: 1.11', - 'Framework :: Django :: 2.1', - 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.0', - 'Framework :: Django :: 3.1', 'Framework :: Django :: 3.2', 'Framework :: Django :: 4.0', 'Framework :: Django :: 4.1', diff --git a/tabular_permissions/static/tabular_permissions/tabular_permissions.js b/tabular_permissions/static/tabular_permissions/tabular_permissions.js index e243db5..564a0f6 100644 --- a/tabular_permissions/static/tabular_permissions/tabular_permissions.js +++ b/tabular_permissions/static/tabular_permissions/tabular_permissions.js @@ -49,4 +49,4 @@ window.onload = function() { user_group_permissions.append(output); }) })(django.jQuery); -}; \ No newline at end of file +}; diff --git a/tests/urls.py b/tests/urls.py index ac5d688..d967a52 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -9,5 +9,3 @@ urlpatterns = [ path('admin/', admin.site.urls), ] - -