From dd9aaf467ea1364196987fa47b96129eb25404c2 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Sun, 4 May 2025 19:34:25 +0200 Subject: [PATCH 1/6] Add editorconfig configuration --- .editorconfig | 25 +++++++++++++++++++++++++ .prettierrc.json | 16 ++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5257a12 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +# https://editorconfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +trim_trailing_whitespace = true + +[*.py] +indent_style = space +indent_size = 4 + +[*.{yaml,yml,toml,md}] +indent_style = space +indent_size = 2 + +[Dockerfile*] +indent_style = space +indent_size = 4 + +[*.json] +indent_style = space +indent_size = 2 diff --git a/.prettierrc.json b/.prettierrc.json index 146a217..8139919 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,10 +1,10 @@ { - "semi": true, - "trailingComma": "es5", - "singleQuote": true, - "printWidth": 90, - "tabWidth": 2, - "useTabs": false, - "bracketSpacing": true, - "arrowParens": "avoid" + "semi": true, + "trailingComma": "es5", + "singleQuote": true, + "printWidth": 90, + "tabWidth": 2, + "useTabs": false, + "bracketSpacing": true, + "arrowParens": "avoid" } From 4c5d3aec28b38a447291330c1d733639372057f4 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Sun, 4 May 2025 19:38:26 +0200 Subject: [PATCH 2/6] Move coverage configuration to pyproject.toml --- .coveragerc | 16 --------- pyproject.toml | 95 +++++++++++++++++++++++++++++--------------------- 2 files changed, 55 insertions(+), 56 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index d1a0d79..0000000 --- a/.coveragerc +++ /dev/null @@ -1,16 +0,0 @@ -[run] -source = ./src/newsreader/ -omit = - **/tests/** - **/migrations/** - **/conf/** - **/apps.py - **/admin.py - **/tests.py - **/urls.py - **/wsgi.py - **/celery.py - **/__init__.py - -[html] -directory = coverage diff --git a/pyproject.toml b/pyproject.toml index c722183..5f0d46a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,66 +1,81 @@ [project] -name = 'newsreader' -version = '0.5.3' -authors = [{ name = 'Sonny', email= 'sonny871@hotmail.com' }] -license = {text = 'GPL-3.0'} -requires-python = '>=3.11' +name = "newsreader" +version = "0.5.3" +authors = [{ name = "Sonny" }] +license = { text = "GPL-3.0" } +requires-python = ">=3.11" dependencies = [ - 'django~=4.2', - 'celery~=5.4', - 'psycopg', - 'django-axes', - 'django-celery-beat~=2.7.0', - 'django-rest-framework', - 'djangorestframework-camel-case', - 'pymemcache', - 'python-dotenv~=1.0.1', - 'ftfy~=6.2', - 'requests', - 'feedparser', - 'bleach', - 'beautifulsoup4', - 'lxml', + "django~=4.2", + "celery~=5.4", + "psycopg", + "django-axes", + "django-celery-beat~=2.7.0", + "django-rest-framework", + "djangorestframework-camel-case", + "pymemcache", + "python-dotenv~=1.0.1", + "ftfy~=6.2", + "requests", + "feedparser", + "bleach", + "beautifulsoup4", + "lxml", ] [dependency-groups] -test-tools = ['ruff', 'factory_boy', 'freezegun'] +test-tools = ["ruff", "factory_boy", "freezegun"] development = [ - 'django-debug-toolbar', - 'django-stubs', - 'django-extensions', + "django-debug-toolbar", + "django-stubs", + "django-extensions", ] -ci = ['coverage~=7.6.1'] -production = ['gunicorn~=23.0'] +ci = ["coverage~=7.6.1"] +production = ["gunicorn~=23.0"] [project.optional-dependencies] -sentry = ['sentry-sdk~=2.0'] +sentry = ["sentry-sdk~=2.0"] [tool.uv] -environments = ["sys_platform == 'linux'"] -default-groups = ['test-tools'] +environments = ["sys_platform == "linux""] +default-groups = ["test-tools"] [tool.ruff] -include = ['pyproject.toml', 'src/**/*.py'] +include = ["pyproject.toml", "src/**/*.py"] line-length = 88 [tool.ruff.lint] -select = ['E4', 'E7', 'E9', 'F', 'I'] +select = ["E4", "E7", "E9", "F", "I"] [tool.ruff.lint.isort] lines-between-types=1 lines-after-imports=2 -default-section = 'third-party' -known-first-party = ['transip_client'] +default-section = "third-party" +known-first-party = ["transip_client"] section-order = [ - 'future', - 'standard-library', - 'django', - 'third-party', - 'first-party', - 'local-folder', + "future", + "standard-library", + "django", + "third-party", + "first-party", + "local-folder", ] [tool.ruff.lint.isort.sections] -django = ['django'] +django = ["django"] + +[tool.coverage.run] +source = ["./src/newsreader/"] +omit = [ + "**/tests/**" + "**/migrations/**", + "**/conf/**", + "**/apps.py", + "**/admin.py", + "**/tests.py", + "**/urls.py", + "**/wsgi.py", + "**/celery.py", + "**/__init__.py +] From 9ba6824dd39ccd8728214333226515622c7bc59c Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Sun, 4 May 2025 19:38:45 +0200 Subject: [PATCH 3/6] Remove unused isort configuration --- .isort.cfg | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index 0c8e37f..0000000 --- a/.isort.cfg +++ /dev/null @@ -1,12 +0,0 @@ -[settings] -include_trailing_comma = true -line_length = 88 -multi_line_output = 3 -skip = env/, venv/ -default_section = THIRDPARTY -known_first_party = newsreader -known_django = django -sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER -lines_between_types=1 -lines_after_imports=2 -lines_between_types=1 From c7f90e233eff9ae4d6053bf22c904355c7164c75 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Sun, 4 May 2025 19:44:00 +0200 Subject: [PATCH 4/6] Move prettier configuration --- .prettierrc.json | 10 ---------- package.json | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 .prettierrc.json diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 8139919..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "semi": true, - "trailingComma": "es5", - "singleQuote": true, - "printWidth": 90, - "tabWidth": 2, - "useTabs": false, - "bracketSpacing": true, - "arrowParens": "avoid" -} diff --git a/package.json b/package.json index 3b251da..f80ceed 100644 --- a/package.json +++ b/package.json @@ -55,5 +55,15 @@ "webpack": "^5.94.0", "webpack-cli": "^5.1.4", "webpack-merge": "^4.2.2" + }, + "prettier": { + "semi": true, + "trailingComma": "es5", + "singleQuote": true, + "printWidth": 90, + "tabWidth": 2, + "useTabs": false, + "bracketSpacing": true, + "arrowParens": "avoid" } } From ebbbe99eafc1b927f426f712126ef52999a56bab Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Sun, 4 May 2025 19:44:55 +0200 Subject: [PATCH 5/6] Update package.json --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index f80ceed..969d646 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "newsreader", "version": "0.5.3", "description": "Application for viewing RSS feeds", - "main": "index.js", "scripts": { "lint": "npx prettier \"src/newsreader/js/**/*.js\" --check", "format": "npx prettier \"src/newsreader/js/**/*.js\" --write", @@ -14,7 +13,7 @@ }, "repository": { "type": "git", - "url": "[git@git.fudiggity.nl:5000]:sonny/newsreader.git" + "url": "forgejo.fudiggity.nl:sonny/newsreader" }, "author": "Sonny", "license": "GPL-3.0-or-later", From a534a3b691b3062726f8ae792da3ef50391ec0c2 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Sun, 4 May 2025 19:52:24 +0200 Subject: [PATCH 6/6] Move jest configuration --- jest.config.js | 6 ------ package.json | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 jest.config.js diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index c8473a7..0000000 --- a/jest.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - roots: ['src/newsreader/js/tests/'], - - clearMocks: true, - coverageDirectory: 'coverage', -}; diff --git a/package.json b/package.json index 969d646..8e1f60f 100644 --- a/package.json +++ b/package.json @@ -64,5 +64,12 @@ "useTabs": false, "bracketSpacing": true, "arrowParens": "avoid" + }, + "jest": { + "roots": [ + "src/newsreader/js/tests/" + ], + "clearMocks": true, + "coverageDirectory": "coverage" } }