diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..7e52c0d --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,6 @@ +# CODEOWNERS - Defines who must review changes to specific files +# See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners + +# GitHub workflows and configuration files require review from repository owners +# This helps protect against unauthorized changes to CI/CD pipelines and automation +/.github/ @GalacticDynamics/dataclassish-maintainers diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..5bd4fe4 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,40 @@ +# .github/labeler.yml +# Automatically apply labels based on file paths + +"๐Ÿ™ˆ Add / update .gitignore": + - changed-files: + - any-glob-to-any-file: "**/.gitignore" + +"๐Ÿ‘ท Add / update CI build system": + - changed-files: + - any-glob-to-any-file: ".github/workflows/**" + +"๐Ÿ”ง Add / update configuration": + - changed-files: + - any-glob-to-any-file: + - "pyproject.toml" + - "noxfile.py" + - ".github/labels.yml" + - ".github/labeler.yml" + - ".github/dependabot.yml" + - ".github/release.yml" + - "conftest.py" + +"๐Ÿ“ Add / update documentation": + - changed-files: + - any-glob-to-any-file: + - "README.md" + - "CONTRIBUTING.md" + - "docs/**" + +"๐Ÿ“„ Add / update license": + - changed-files: + - any-glob-to-any-file: "LICENSE" + +"โœ… Add / update / pass tests": + - changed-files: + - any-glob-to-any-file: "tests/**" + +"โฑ๏ธ Run benchmarks": + - changed-files: + - any-glob-to-any-file: "tests/benchmark/**" diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..75317b3 --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,306 @@ +# .github/labels.yml +# Gitmoji labels for GitHub issues and pull requests + +- name: "๐ŸŽจ Improve code structure / format" + color: "e3d7ff" + description: "Improve structure / format of the code." + +- name: "โšก๏ธ Improve performance" + color: "fbca04" + description: "Improve performance." + +- name: "๐Ÿ”ฅ Remove code or files" + color: "d73a4a" + description: "Remove code or files." + +- name: "๐Ÿ› Fix a bug" + color: "d73a4a" + description: "Fix a bug." + +- name: "๐Ÿš‘๏ธ Critical hotfix" + color: "b60205" + description: "Critical hotfix." + +- name: "โœจ Introduce new features" + color: "0e8a16" + description: "Introduce new features." + +- name: "๐Ÿ“ Add / update documentation" + color: "0075ca" + description: "Add or update documentation." + +- name: "๐Ÿš€ Deploy" + color: "5319e7" + description: "Deploy stuff." + +- name: "๐Ÿ’„ Add / update UI and styles" + color: "f9d0c4" + description: "Add or update the UI and style files." + +- name: "๐ŸŽ‰ Begin a project" + color: "0e8a16" + description: "Begin a project." + +- name: "โœ… Add / update / pass tests" + color: "0e8a16" + description: "Add, update, or pass tests." + +- name: "๐Ÿ”’๏ธ Fix security / privacy issues" + color: "d73a4a" + description: "Fix security or privacy issues." + +- name: "๐Ÿ” Add / update secrets" + color: "d4c5f9" + description: "Add or update secrets." + +- name: "๐Ÿ”– Release / version tags" + color: "fbca04" + description: "Release / Version tags." + +- name: "๐Ÿšจ Fix compiler / linter warnings" + color: "fbca04" + description: "Fix compiler / linter warnings." + +- name: "๐Ÿšง Work in progress" + color: "fbca04" + description: "Work in progress." + +- name: "๐Ÿ’š Fix CI build" + color: "0e8a16" + description: "Fix CI Build." + +- name: "โฌ‡๏ธ Downgrade dependencies" + color: "0366d6" + description: "Downgrade dependencies." + +- name: "โฌ†๏ธ Upgrade dependencies" + color: "0366d6" + description: "Upgrade dependencies." + +- name: "๐Ÿ“Œ Pin dependencies" + color: "0366d6" + description: "Pin dependencies to specific versions." + +- name: "๐Ÿ‘ท Add / update CI build system" + color: "1d76db" + description: "Add or update CI build system." + +- name: "๐Ÿ“ˆ Add / update analytics" + color: "c5def5" + description: "Add or update analytics or track code." + +- name: "โ™ป๏ธ Refactor code" + color: "e3d7ff" + description: "Refactor code." + +- name: "โž• Add a dependency" + color: "0366d6" + description: "Add a dependency." + +- name: "โž– Remove a dependency" + color: "0366d6" + description: "Remove a dependency." + +- name: "๐Ÿ”ง Add / update configuration" + color: "d4c5f9" + description: "Add or update configuration files." + +- name: "๐Ÿ”จ Add / update development scripts" + color: "bfd4f2" + description: "Add or update development scripts." + +- name: "๐ŸŒ Internationalization / localization" + color: "c5def5" + description: "Internationalization and localization." + +- name: "โœ๏ธ Fix typos" + color: "ffffff" + description: "Fix typos." + +- name: "๐Ÿ’ฉ Bad code (needs improvement)" + color: "7057ff" + description: "Write bad code that needs to be improved." + +- name: "โช๏ธ Revert changes" + color: "fbca04" + description: "Revert changes." + +- name: "๐Ÿ”€ Merge branches" + color: "e99695" + description: "Merge branches." + +- name: "๐Ÿ“ฆ๏ธ Add / update packages" + color: "bfd4f2" + description: "Add or update compiled files or packages." + +- name: "๐Ÿ‘ฝ๏ธ Update due to external API changes" + color: "5319e7" + description: "Update code due to external API changes." + +- name: "๐Ÿšš Move / rename resources" + color: "e3d7ff" + description: "Move or rename resources (e.g.: files, paths, routes)." + +- name: "๐Ÿ“„ Add / update license" + color: "d4c5f9" + description: "Add or update license." + +- name: "๐Ÿ’ฅ Introduce breaking changes" + color: "b60205" + description: "Introduce breaking changes." + +- name: "๐Ÿฑ Add / update assets" + color: "f9d0c4" + description: "Add or update assets." + +- name: "โ™ฟ๏ธ Improve accessibility" + color: "c5def5" + description: "Improve accessibility." + +- name: "๐Ÿ’ก Add / update source code comments" + color: "fef2c0" + description: "Add or update comments in source code." + +- name: "๐Ÿป Write code drunkenly" + color: "fbca04" + description: "Write code drunkenly." + +- name: "๐Ÿ’ฌ Add / update text and literals" + color: "c5def5" + description: "Add or update text and literals." + +- name: "๐Ÿ—ƒ๏ธ Database changes" + color: "bfdadc" + description: "Perform database related changes." + +- name: "๐Ÿ”Š Add / update logs" + color: "c5def5" + description: "Add or update logs." + +- name: "๐Ÿ”‡ Remove logs" + color: "c5def5" + description: "Remove logs." + +- name: "๐Ÿ‘ฅ Add / update contributors" + color: "bfdadc" + description: "Add or update contributor(s)." + +- name: "๐Ÿšธ Improve UX / usability" + color: "fbca04" + description: "Improve user experience / usability." + +- name: "๐Ÿ—๏ธ Architectural changes" + color: "e3d7ff" + description: "Make architectural changes." + +- name: "๐Ÿ“ฑ Work on responsive design" + color: "f9d0c4" + description: "Work on responsive design." + +- name: "๐Ÿคก Mock things" + color: "fef2c0" + description: "Mock things." + +- name: "๐Ÿฅš Add / update easter egg" + color: "fef2c0" + description: "Add or update an easter egg." + +- name: "๐Ÿ™ˆ Add / update .gitignore" + color: "d4c5f9" + description: "Add or update a .gitignore file." + +- name: "๐Ÿ“ธ Add / update snapshots" + color: "bfdadc" + description: "Add or update snapshots." + +- name: "โš—๏ธ Perform experiments" + color: "d876e3" + description: "Perform experiments." + +- name: "๐Ÿ”๏ธ Improve SEO" + color: "c5def5" + description: "Improve SEO." + +- name: "๐Ÿท๏ธ Add / update types" + color: "c5def5" + description: "Add or update types." + +- name: "๐ŸŒฑ Add / update seed files" + color: "0e8a16" + description: "Add or update seed files." + +- name: "๐Ÿšฉ Add / update / remove feature flags" + color: "fbca04" + description: "Add, update, or remove feature flags." + +- name: "๐Ÿฅ… Catch errors" + color: "d73a4a" + description: "Catch errors." + +- name: "๐Ÿ’ซ Add / update animations" + color: "f9d0c4" + description: "Add or update animations and transitions." + +- name: "๐Ÿ—‘๏ธ Deprecate code" + color: "d73a4a" + description: "Deprecate code that needs to be cleaned up." + +- name: "๐Ÿ›‚ Authorization / roles / permissions" + color: "d4c5f9" + description: "Work on code related to authorization, roles and permissions." + +- name: "๐Ÿฉน Simple fix (non-critical)" + color: "d73a4a" + description: "Simple fix for a non-critical issue." + +- name: "๐Ÿง Data exploration / inspection" + color: "c5def5" + description: "Data exploration/inspection." + +- name: "โšฐ๏ธ Remove dead code" + color: "d73a4a" + description: "Remove dead code." + +- name: "๐Ÿงช Add a failing test" + color: "0e8a16" + description: "Add a failing test." + +- name: "๐Ÿ‘” Add / update business logic" + color: "1d76db" + description: "Add or update business logic." + +- name: "๐Ÿฉบ Add / update healthcheck" + color: "0e8a16" + description: "Add or update healthcheck." + +- name: "๐Ÿงฑ Infrastructure changes" + color: "bfdadc" + description: "Infrastructure related changes." + +- name: "๐Ÿง‘โ€๐Ÿ’ป Improve developer experience" + color: "c5def5" + description: "Improve developer experience." + +- name: "๐Ÿ’ธ Add sponsorships / financial infrastructure" + color: "0e8a16" + description: "Add sponsorships or money related infrastructure." + +- name: "๐Ÿงต Add / update multithreading / concurrency" + color: "d876e3" + description: "Add or update code related to multithreading or concurrency." + +- name: "๐Ÿฆบ Add / update validation" + color: "fbca04" + description: "Add or update code related to validation." + +- name: "โœˆ๏ธ Improve offline support" + color: "c5def5" + description: "Improve offline support." + +- name: "๐Ÿฆ– Add backwards compatibility" + color: "0e8a16" + description: "Code that adds backwards compatibility." + +- name: "โฑ๏ธ Run benchmarks" + color: "d876e3" + description: "Run benchmarks." diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..b64abff --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,125 @@ +changelog: + exclude: + authors: + - dependabot[bot] + - pre-commit-ci[bot] + categories: + - title: ๐Ÿ’ฅ Breaking Changes + labels: + - "๐Ÿ’ฅ Introduce breaking changes" + - title: โœจ New Features + labels: + - "โœจ Introduce new features" + - "๐ŸŽ‰ Begin a project" + - title: ๐Ÿ› Bug Fixes + labels: + - "๐Ÿ› Fix a bug" + - "๐Ÿš‘๏ธ Critical hotfix" + - "๐Ÿฉน Simple fix (non-critical)" + - "๐Ÿฅ… Catch errors" + - "๐Ÿšจ Fix compiler / linter warnings" + - "โœ๏ธ Fix typos" + - title: ๐Ÿ”’๏ธ Security + labels: + - "๐Ÿ”’๏ธ Fix security / privacy issues" + - "๐Ÿ” Add / update secrets" + - "๐Ÿ›‚ Authorization / roles / permissions" + - title: โšก๏ธ Performance + labels: + - "โšก๏ธ Improve performance" + - "๐Ÿงต Add / update multithreading / concurrency" + - title: ๐Ÿ“ Documentation + labels: + - "๐Ÿ“ Add / update documentation" + - "๐Ÿ’ก Add / update source code comments" + - "๐Ÿ“„ Add / update license" + - title: ๐ŸŽจโ™ป๏ธ Code Quality & Refactoring + labels: + - "๐ŸŽจ Improve code structure / format" + - "โ™ป๏ธ Refactor code" + - "โšฐ๏ธ Remove dead code" + - "๐Ÿ”ฅ Remove code or files" + - "๐Ÿšš Move / rename resources" + - "๐Ÿ—‘๏ธ Deprecate code" + - title: โœ… Testing + labels: + - "โœ… Add / update / pass tests" + - "๐Ÿงช Add a failing test" + - "๐Ÿ“ธ Add / update snapshots" + - "๐Ÿคก Mock things" + - title: ๐Ÿ”ง Configuration & Dependencies + labels: + - "๐Ÿ”ง Add / update configuration" + - "โฌ†๏ธ Upgrade dependencies" + - "โฌ‡๏ธ Downgrade dependencies" + - "๐Ÿ“Œ Pin dependencies" + - "โž• Add a dependency" + - "โž– Remove a dependency" + - "๐Ÿšฉ Add / update / remove feature flags" + - title: ๐Ÿ—๏ธ Architecture & Infrastructure + labels: + - "๐Ÿ—๏ธ Architectural changes" + - "๐Ÿงฑ Infrastructure changes" + - "๐Ÿ‘ท Add / update CI build system" + - "๐Ÿ’š Fix CI build" + - "๐Ÿ“ฆ๏ธ Add / update packages" + - "๐Ÿฑ Add / update assets" + - title: ๐Ÿš€ Deployment & Releases + labels: + - "๐Ÿš€ Deploy" + - "๐Ÿ”– Release / version tags" + - title: ๐ŸŽจ UI & Styling + labels: + - "๐Ÿ’„ Add / update UI and styles" + - "๐Ÿ’ซ Add / update animations" + - "๐Ÿ“ฑ Work on responsive design" + - title: โ™ฟ๏ธ Accessibility & UX + labels: + - "โ™ฟ๏ธ Improve accessibility" + - "๐Ÿšธ Improve UX / usability" + - "โœˆ๏ธ Improve offline support" + - title: ๐ŸŒ Internationalization + labels: + - "๐ŸŒ Internationalization / localization" + - "๐Ÿ’ฌ Add / update text and literals" + - title: ๐Ÿ—ƒ๏ธ Data & Database + labels: + - "๐Ÿ—ƒ๏ธ Database changes" + - "๐ŸŒฑ Add / update seed files" + - title: ๐Ÿ”Š Logging & Monitoring + labels: + - "๐Ÿ”Š Add / update logs" + - "๐Ÿ”‡ Remove logs" + - "๐Ÿฉบ Add / update healthcheck" + - "๐Ÿ”๏ธ Improve SEO" + - "๐Ÿ“ˆ Add / update analytics" + - title: ๐Ÿท๏ธ Types & Validation + labels: + - "๐Ÿท๏ธ Add / update types" + - "๐Ÿฆบ Add / update validation" + - title: ๐Ÿ‘” Business Logic & Sponsorship + labels: + - "๐Ÿ‘” Add / update business logic" + - "๐Ÿ’ธ Add sponsorships / financial infrastructure" + - title: ๐Ÿ”จ Development Experience + labels: + - "๐Ÿ”จ Add / update development scripts" + - "๐Ÿง‘โ€๐Ÿ’ป Improve developer experience" + - "๐Ÿ™ˆ Add / update .gitignore" + - "๐Ÿ”€ Merge branches" + - "โช๏ธ Revert changes" + - title: ๐Ÿ‘ฝ๏ธ๐Ÿฆ– External & Backwards Compatibility Changes + labels: + - "๐Ÿ‘ฝ๏ธ Update due to external API changes" + - "๐Ÿฆ– Add backwards compatibility" + - title: ๐Ÿšง Work in Progress & Experiments + labels: + - "๐Ÿšง Work in progress" + - "โš—๏ธ Perform experiments" + - "๐Ÿง Data exploration / inspection" + - title: ๐Ÿป Miscellaneous + labels: + - "๐Ÿป Write code drunkenly" + - "๐Ÿ’ฉ Bad code (needs improvement)" + - "๐Ÿฅš Add / update easter egg" + - "๐Ÿ‘ฅ Add / update contributors" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..167222a --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,70 @@ +name: Auto-label PRs + +on: + pull_request_target: + types: [opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: write + issues: write + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + - name: Label from commit emojis + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + // Get all repository labels (with pagination) and build emoji-to-label map + const repoLabels = await github.paginate( + github.rest.issues.listLabelsForRepo, + { + owner: context.repo.owner, + repo: context.repo.repo, + per_page: 100, + } + ); + + const labelMap = {}; + for (const label of repoLabels) { + // Extract the emoji from the label name (first character(s)) + const match = label.name.match(/^(\p{Emoji}[\u200d\ufe0f]*)/u); + if (match) { + const emoji = match[1]; + labelMap[emoji] = label.name; + } + } + + const { data: commits } = await github.rest.pulls.listCommits({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number, + }); + + const labelsToAdd = new Set(); + for (const commit of commits) { + const message = commit.commit.message; + // Check if message starts with an emoji + for (const [emoji, label] of Object.entries(labelMap)) { + if (message.startsWith(emoji)) { + labelsToAdd.add(label); + break; + } + } + } + + if (labelsToAdd.size > 0) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: Array.from(labelsToAdd) + }); + } diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 0000000..9ecbab5 --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -0,0 +1,22 @@ +name: Sync labels + +on: + workflow_dispatch: + push: + paths: + - ".github/labels.yml" + +permissions: + issues: write + pull-requests: write + contents: read + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: EndBug/label-sync@v2 + with: + config-file: .github/labels.yml + delete-other-labels: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e4dcbda..dde4d06 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -82,3 +82,8 @@ repos: - id: check-dependabot - id: check-github-workflows - id: check-readthedocs + + - repo: https://github.com/ComPWA/taplo-pre-commit + rev: v0.9.3 + hooks: + - id: taplo-format diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 0000000..7b0c67a --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,27 @@ +# Taplo TOML formatter configuration +# https://taplo.tamasfe.dev/configuration/file.html + +[formatting] +# Alphabetically reorder keys that are not separated by blank lines +reorder_keys = true + +# Align entries vertically (entries with table headers, comments, or blank lines between them are not aligned) +align_entries = true + +# Align consecutive comments after entries and items vertically +align_comments = true + +# Additional formatting options +allowed_blank_lines = 2 +array_auto_collapse = true +array_auto_expand = true +array_trailing_comma = true +column_width = 80 +compact_arrays = true +compact_entries = false +compact_inline_tables = false +crlf = false +indent_entries = false +indent_string = " " +indent_tables = false +trailing_newline = true diff --git a/pyproject.toml b/pyproject.toml index 101bbfe..a73727d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,7 @@ [project] -name = "dataclassish" authors = [ { name = "Nathaniel Starkman", email = "nstarman@users.noreply.github.com" }, ] -description = "dataclass tools, extended by multiple dispatch" -readme = "README.md" -license.file = "LICENSE" -requires-python = ">=3.10" classifiers = [ "Development Status :: 1 - Planning", "Intended Audience :: Science/Research", @@ -23,25 +18,28 @@ classifiers = [ "Topic :: Scientific/Engineering", "Typing :: Typed", ] +dependencies = ["plum-dispatch>=2.5.1", "typing_extensions>=4.12.2"] +description = "dataclass tools, extended by multiple dispatch" dynamic = ["version"] -dependencies = [ - "plum-dispatch>=2.5.1", - "typing_extensions>=4.12.2", -] +license.file = "LICENSE" +name = "dataclassish" +readme = "README.md" +requires-python = ">=3.10" [project.urls] -Homepage = "https://github.com/GalacticDynamics/dataclassish" "Bug Tracker" = "https://github.com/GalacticDynamics/dataclassish/issues" -Discussions = "https://github.com/GalacticDynamics/dataclassish/discussions" -Changelog = "https://github.com/GalacticDynamics/dataclassish/releases" +Changelog = "https://github.com/GalacticDynamics/dataclassish/releases" +Discussions = "https://github.com/GalacticDynamics/dataclassish/discussions" +Homepage = "https://github.com/GalacticDynamics/dataclassish" [build-system] -requires = ["hatchling", "hatch-vcs"] build-backend = "hatchling.build" +requires = ["hatchling", "hatch-vcs"] [dependency-groups] +build = ["build>=1.3.0"] dev = [ "cz-conventional-gitmoji>=0.6.1", { "include-group" = "build" }, @@ -49,33 +47,23 @@ dev = [ { "include-group" = "nox" }, { "include-group" = "test" }, ] -nox = [ - "nox>=2024.10.9", - "nox-uv>=0.6.3", -] +lint = ["mypy>=1.19.0", "pre-commit>=4.5.0", "pylint>=4.0.4"] +nox = ["nox>=2024.10.9", "nox-uv>=0.6.3"] test = [ "attrs>=25.4.0", "pytest>=8.4.2", "pytest-cov>=7.0.0", "sybil[pytest]>=9.2.0", ] -build = [ - "build>=1.3.0", -] -lint = [ - "mypy>=1.19.0", - "pre-commit>=4.5.0", - "pylint>=4.0.4", -] [tool.hatch] -version.source = "vcs" build.hooks.vcs.version-file = "src/dataclassish/_version.py" build.hooks.vcs.version-file-template = """\ version: str = {version!r} version_tuple: tuple[int, int, int] | tuple[int, int, int, str, str] version_tuple = {version_tuple!r} """ +version.source = "vcs" [tool.codespell] @@ -87,60 +75,53 @@ name = "cz_gitmoji" [tool.coverage] -run.source = ["dataclassish"] -report.exclude_also = [ - '\.\.\.', - 'if TYPE_CHECKING:', -] +report.exclude_also = ['\.\.\.', 'if TYPE_CHECKING:'] +run.source = ["dataclassish"] [tool.mypy] -files = ["src"] -python_version = "3.10" -warn_unused_configs = true -strict = true -enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] -warn_unreachable = true -disallow_untyped_defs = false disallow_incomplete_defs = false +disallow_untyped_defs = false +enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] +files = ["src"] +python_version = "3.10" +strict = true +warn_unreachable = true +warn_unused_configs = true [[tool.mypy.overrides]] -module = "dataclassish.*" -disallow_untyped_defs = true disallow_incomplete_defs = true +disallow_untyped_defs = true +module = "dataclassish.*" [[tool.mypy.overrides]] ignore_missing_imports = true -module = ["plum.*"] +module = ["plum.*"] [tool.pylint] -py-version = "3.11" -ignore-paths = [".*/_version.py"] -reports.output-format = "colorized" -similarities.ignore-imports = "yes" disable = [ "fixme", - "function-redefined", # incompatible with plum-dispatch - "line-too-long", # handled by ruff - "no-member", # handled by mypy - "too-few-public-methods", # Protocols + "function-redefined", # incompatible with plum-dispatch + "line-too-long", # handled by ruff + "no-member", # handled by mypy + "too-few-public-methods", # Protocols "too-many-function-args", # incompatible with plum-dispatch - "unused-argument", # handled by ruff + "unused-argument", # handled by ruff ] +ignore-paths = [".*/_version.py"] +py-version = "3.11" +reports.output-format = "colorized" +similarities.ignore-imports = "yes" [tool.pytest.ini_options] -minversion = "8.0" -addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] -xfail_strict = true -filterwarnings = [ - "error", -] -log_cli_level = "INFO" -testpaths = [ - "README.md", "src", "tests", -] +addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] +filterwarnings = ["error"] +log_cli_level = "INFO" +minversion = "8.0" +testpaths = ["README.md", "src", "tests"] +xfail_strict = true [tool.ruff] @@ -149,25 +130,25 @@ src = ["src"] [tool.ruff.lint] extend-select = ["ALL"] ignore = [ - "ANN401", # Dynamically typed expressions are disallowed in `**kwargs` - "COM812", # For ruff.format - "D203", # 1 blank line required before class docstring - "D213", # Multi-line docstring summary should start at the first line - "F811", # Redefinition of unused '...' (for plum-dispatch) - "FIX002", # Line contains TODO - "ISC001", # Conflicts with formatter - "PLR09", # Too many <...> - "PLR2004", # Magic value used in comparison - "RUF022", # `__all__` is not sorted - "TD002", # Missing author in TODO - "TD003", # Missing issue link on the line following this TODO + "ANN401", # Dynamically typed expressions are disallowed in `**kwargs` + "COM812", # For ruff.format + "D203", # 1 blank line required before class docstring + "D213", # Multi-line docstring summary should start at the first line + "F811", # Redefinition of unused '...' (for plum-dispatch) + "FIX002", # Line contains TODO + "ISC001", # Conflicts with formatter + "PLR09", # Too many <...> + "PLR2004", # Magic value used in comparison + "RUF022", # `__all__` is not sorted + "TD002", # Missing author in TODO + "TD003", # Missing issue link on the line following this TODO ] [tool.ruff.lint.per-file-ignores] -"tests/**" = ["ANN", "S101", "T20"] -"noxfile.py" = ["T20"] "docs/conf.py" = ["INP001"] +"noxfile.py" = ["T20"] +"tests/**" = ["ANN", "S101", "T20"] [tool.ruff.lint.isort] -combine-as-imports = true +combine-as-imports = true extra-standard-library = ["typing_extensions"]