Skip to content

chore: add ruff linting#385

Merged
iFergal merged 1 commit intoWebOfTrust:mainfrom
lenkan:ruff-check
Sep 30, 2025
Merged

chore: add ruff linting#385
iFergal merged 1 commit intoWebOfTrust:mainfrom
lenkan:ruff-check

Conversation

@lenkan
Copy link
Copy Markdown
Collaborator

@lenkan lenkan commented Sep 22, 2025

Adds ruff linting with default rules (https://docs.astral.sh/ruff/rules/)

If you're just getting started with Ruff, the default rule set is a great place to start: it catches a wide variety of common errors (like unused imports) with zero configuration.

  • Removes flake8 checks to avoid having conflicting reports in the future.
    • I can add an equivalent ruff check to print warnings like this did before - but I don't see any value in it if it doesn't stop the build
      # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
      flake8 . --count --exit-zero --ignore=E7,F841,E301,E302,E303 --max-complexity=10 --max-line-length=127 --statistics
      
  • Uses extras_require.dev to specify dev dependencies - I don't know if this is common way to specify development dependencies, but I found some examples where that is done. Please advice.
  • All changes to source code are auto-fixed except: https://github.com/WebOfTrust/keria/compare/main...lenkan:keria:ruff-check?expand=1#diff-efec556acc809a758da25056e617702341fdc34bd639435343177e138c2e61a5R932

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 22, 2025

Codecov Report

❌ Patch coverage is 93.51852% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.45%. Comparing base (676d7e8) to head (eb0ce88).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/keria/app/ipexing.py 16.66% 5 Missing ⚠️
src/keria/app/grouping.py 0.00% 1 Missing ⚠️
src/keria/app/serving.py 66.66% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (61.11%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #385      +/-   ##
==========================================
- Coverage   93.80%   93.45%   -0.36%     
==========================================
  Files          37       37              
  Lines        8462     8543      +81     
==========================================
+ Hits         7938     7984      +46     
- Misses        524      559      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@m00sey m00sey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like an overall improvement

@lenkan lenkan requested review from iFergal and kentbull September 30, 2025 14:10
Copy link
Copy Markdown
Collaborator

@iFergal iFergal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@iFergal
Copy link
Copy Markdown
Collaborator

iFergal commented Sep 30, 2025

merging as the codecov shouldn't block these code style or formatting changes

@iFergal iFergal merged commit 2c6e505 into WebOfTrust:main Sep 30, 2025
4 of 5 checks passed
@lenkan lenkan deleted the ruff-check branch September 30, 2025 14:48
kentbull pushed a commit to kentbull/keria that referenced this pull request Sep 30, 2025
lenkan added a commit to global-vlei/keria that referenced this pull request Nov 3, 2025
* fix: delete keria specific indexes when deleting a credential (WebOfTrust#358)

* fix: delete keria specific indexees when deleting a credential

* chore: upgrade setuptools

* fix: send agent and controller KEL on IPEX grant

This resolves the long-standing double present bug where presenting the first credential from KERIA would fail because the destination did not have the agent KEL.

* fix: remove explicit dependency on setuptools

* adds MAINTAINERS.md

Signed-off-by: Kevin Griffin <griffin.kev@gmail.com>

* adds MAINTAINERS.md

Signed-off-by: Kevin Griffin <griffin.kev@gmail.com>

* add hab name, prefix to logs; fix GracefulShutdownDoer to use KeyboardInterrupt instead of Doist.exit() (WebOfTrust#363)

* feat: add hab name and prefix partial to log messages

* feat: add TruncatedFormatter for logs; refactor GracefulShutdownDoer

The TruncatedFormatter gives human readability with visual "rivers" and the GracefulShutdownDoer properly throws a KeyboardInterrupt to cause the main Doist loop to exit."

* fix: use full, not abbreviated AID in logs

* feat,docs: correct the graceful shutdown logic

This uses the DoDoer logic properly to check shutdown conditions on each loop and then act appropriately on receiving the shutdown signal.

* docs: add in documentation for various components

* chore: remove extra label from log messages

* chore: bump version to 0.2.0 for release to PyPi and Docker HUb

* chore: add ruff linting (WebOfTrust#385)

* chore: add ruff linting (WebOfTrust#385)

* fix: KERIA server exits (exit code 1) on admit call with 'NoneType' object has no attribute 'ked' (WebOfTrust#379)

* is:issue KERIA server exits (exit code 1) on admit call with 'NoneType' object has no attribute 'ked' WebOfTrust#371

* remove checking grant and change parser for all of enpoints in ipex

---------

Co-authored-by: iFergal <fergaloconnor1998@gmail.com>

* credentialing.py type hints and auto-generated OpenAPI specs (WebOfTrust#373)

* spike: Feasibility of generating Signify types from Python type hints via OpenAPI

* Revert "spike: Feasibility of generating Signify types from Python type hints via OpenAPI"

This reverts commit 4901f19.

* split Operation then using allOf in openapi schemas

* demo generated types for credentials().get()

* fix some option properties and add schema for CredentialState

* Add custom class for empty dict schema

* fix credentials types + add registries's types

* Add remaining schemas for credentialing

* resolve review comments

* fix errors/warning for swagger validator

* resolve review comments

* resolve review comments

* Remove unused import

* fix lints and tests

* integrate mypy check and fix type errors for credentialing.py

* remove some unuse schemas

* resolve review comment + add utils for auto generate dataclass/schema from FieldDom

* support dip, drt for anc

* fix lints issue

* refactor openapi utils

* support dip, drt for anc: fix dataclass

* refactor: move logging and http concerns to modules

Moved both console logging and HTTP request logging to the logs and httping modules to clean up the agenting module and keep concerns separate.

Adds basic HTTP request logging configurable by log level.

* feat: respect temp arg and allow cf to be passed in

This allows for consistent testability where all configuration files and LMDB databases will or will not be created in tempfiles. Being able to pass a cf in means this can be more easily tested from an end-to-end integration test, which is my goal here.

* feat: make Agency configuration more testable

Externalize the Configer instance so that both the Agency and all Agent instances can be configured in a test prior to Agency startup.

* fix: SignifyPy compatibility for CredentialCollectionEnd

For some reason SignifyTS uses the 'ri' field to identify a registry and SignifyPy uses the 'ii' field to identify a registry. They should both use the 'rd' field in the future.

* fix: correct indentation for getAgency find function

* docs: Add ParserDoer.recur documentation

* feat: upgrade to KERI 1.2.7 and new HIO

* refactor: simplify Grant debugging with gathering GrantDoer

GrantDoer collects all dependent KEL and TEL event artifacts for an ACDC into a single list making it easier to debug a transmission.

* refactor: rename, use vars, remove indirection

* refactor: move logging to monitoring package

* refactor: disable request logging by default, add --logrequests option

* refactor: move grant cue processor into recur

* refactor: simplify middleware

* add ruff format check

* run ruff format

* add docker step to ci

* downgrade lmdb

* aiding.py type hints and auto-generated OpenAPI specs (WebOfTrust#391)

* spike: Feasibility of generating Signify types from Python type hints via OpenAPI

* Revert "spike: Feasibility of generating Signify types from Python type hints via OpenAPI"

This reverts commit 4901f19.

* split Operation then using allOf in openapi schemas

* demo generated types for credentials().get()

* fix some option properties and add schema for CredentialState

* Add custom class for empty dict schema

* fix credentials types + add registries's types

* Add remaining schemas for credentialing

* resolve review comments

* fix errors/warning for swagger validator

* resolve review comments

* resolve review comments

* Remove unused import

* fix lints and tests

* integrate mypy check and fix type errors for credentialing.py

* remove some unuse schemas

* resolve review comment + add utils for auto generate dataclass/schema from FieldDom

* support dip, drt for anc

* fix lints issue

* refactor openapi utils

* support dip, drt for anc: fix dataclass

* aiding.py type hints and auto-generated OpenAPI specs

* Add data schema for GroupMemberCollectionEnd

* resolve review comments

* fix review comments

* change type for "nt", "kt"

* do not handle required/optional field for dataclass from FieldDom

* fix lint error

* fix cover tests

* update specing test

* update and use new openapi utils

* update kt, nt field: allow string or array of strings or array of array of strings

* update openapi spec

* fix lints

* resolve review comments

* resolve conflicts, fix lints and update spec test

* Migrate from setuptools to uv depdendency management

* pin uv version to avoid breaking in the future

* simplify config

* fix python install

* fix: renaming identifier can overwrite other identifiers with same name WebOfTrust#322 (WebOfTrust#392)

* fix: use exn.rp field as recipient for exchange message (#3)

* fix: agent config not picked up from parameters

When agent URLs where only provided through parameters (from env
variables), the "dt" field was not set, which caused keripy to ignore
the configuration. This PR ensure that "dt" field is set.

* Revert "fix: KERIA server exits (exit code 1) on admit call with 'NoneType' object has no attribute 'ked' (WebOfTrust#379)"

This reverts commit 47e424b.

* uv sync

---------

Signed-off-by: Kevin Griffin <griffin.kev@gmail.com>
Co-authored-by: Fergal <fergaloconnor1998@gmail.com>
Co-authored-by: Kent Bull <kent@kentbull.com>
Co-authored-by: Kevin Griffin <griffin.kev@gmail.com>
Co-authored-by: Sotatek-Patrick-Vu <patrick.vu@sotatek.com>
lenkan added a commit to global-vlei/keria that referenced this pull request Nov 3, 2025
* fix: delete keria specific indexes when deleting a credential (WebOfTrust#358)

* fix: delete keria specific indexees when deleting a credential

* chore: upgrade setuptools

* fix: send agent and controller KEL on IPEX grant

This resolves the long-standing double present bug where presenting the first credential from KERIA would fail because the destination did not have the agent KEL.

* fix: remove explicit dependency on setuptools

* adds MAINTAINERS.md

Signed-off-by: Kevin Griffin <griffin.kev@gmail.com>

* adds MAINTAINERS.md

Signed-off-by: Kevin Griffin <griffin.kev@gmail.com>

* add hab name, prefix to logs; fix GracefulShutdownDoer to use KeyboardInterrupt instead of Doist.exit() (WebOfTrust#363)

* feat: add hab name and prefix partial to log messages

* feat: add TruncatedFormatter for logs; refactor GracefulShutdownDoer

The TruncatedFormatter gives human readability with visual "rivers" and the GracefulShutdownDoer properly throws a KeyboardInterrupt to cause the main Doist loop to exit."

* fix: use full, not abbreviated AID in logs

* feat,docs: correct the graceful shutdown logic

This uses the DoDoer logic properly to check shutdown conditions on each loop and then act appropriately on receiving the shutdown signal.

* docs: add in documentation for various components

* chore: remove extra label from log messages

* chore: bump version to 0.2.0 for release to PyPi and Docker HUb

* chore: add ruff linting (WebOfTrust#385)

* chore: add ruff linting (WebOfTrust#385)

* fix: KERIA server exits (exit code 1) on admit call with 'NoneType' object has no attribute 'ked' (WebOfTrust#379)

* is:issue KERIA server exits (exit code 1) on admit call with 'NoneType' object has no attribute 'ked' WebOfTrust#371

* remove checking grant and change parser for all of enpoints in ipex

---------

Co-authored-by: iFergal <fergaloconnor1998@gmail.com>

* credentialing.py type hints and auto-generated OpenAPI specs (WebOfTrust#373)

* spike: Feasibility of generating Signify types from Python type hints via OpenAPI

* Revert "spike: Feasibility of generating Signify types from Python type hints via OpenAPI"

This reverts commit 4901f19.

* split Operation then using allOf in openapi schemas

* demo generated types for credentials().get()

* fix some option properties and add schema for CredentialState

* Add custom class for empty dict schema

* fix credentials types + add registries's types

* Add remaining schemas for credentialing

* resolve review comments

* fix errors/warning for swagger validator

* resolve review comments

* resolve review comments

* Remove unused import

* fix lints and tests

* integrate mypy check and fix type errors for credentialing.py

* remove some unuse schemas

* resolve review comment + add utils for auto generate dataclass/schema from FieldDom

* support dip, drt for anc

* fix lints issue

* refactor openapi utils

* support dip, drt for anc: fix dataclass

* refactor: move logging and http concerns to modules

Moved both console logging and HTTP request logging to the logs and httping modules to clean up the agenting module and keep concerns separate.

Adds basic HTTP request logging configurable by log level.

* feat: respect temp arg and allow cf to be passed in

This allows for consistent testability where all configuration files and LMDB databases will or will not be created in tempfiles. Being able to pass a cf in means this can be more easily tested from an end-to-end integration test, which is my goal here.

* feat: make Agency configuration more testable

Externalize the Configer instance so that both the Agency and all Agent instances can be configured in a test prior to Agency startup.

* fix: SignifyPy compatibility for CredentialCollectionEnd

For some reason SignifyTS uses the 'ri' field to identify a registry and SignifyPy uses the 'ii' field to identify a registry. They should both use the 'rd' field in the future.

* fix: correct indentation for getAgency find function

* docs: Add ParserDoer.recur documentation

* feat: upgrade to KERI 1.2.7 and new HIO

* refactor: simplify Grant debugging with gathering GrantDoer

GrantDoer collects all dependent KEL and TEL event artifacts for an ACDC into a single list making it easier to debug a transmission.

* refactor: rename, use vars, remove indirection

* refactor: move logging to monitoring package

* refactor: disable request logging by default, add --logrequests option

* refactor: move grant cue processor into recur

* refactor: simplify middleware

* add ruff format check

* run ruff format

* add docker step to ci

* downgrade lmdb

* aiding.py type hints and auto-generated OpenAPI specs (WebOfTrust#391)

* spike: Feasibility of generating Signify types from Python type hints via OpenAPI

* Revert "spike: Feasibility of generating Signify types from Python type hints via OpenAPI"

This reverts commit 4901f19.

* split Operation then using allOf in openapi schemas

* demo generated types for credentials().get()

* fix some option properties and add schema for CredentialState

* Add custom class for empty dict schema

* fix credentials types + add registries's types

* Add remaining schemas for credentialing

* resolve review comments

* fix errors/warning for swagger validator

* resolve review comments

* resolve review comments

* Remove unused import

* fix lints and tests

* integrate mypy check and fix type errors for credentialing.py

* remove some unuse schemas

* resolve review comment + add utils for auto generate dataclass/schema from FieldDom

* support dip, drt for anc

* fix lints issue

* refactor openapi utils

* support dip, drt for anc: fix dataclass

* aiding.py type hints and auto-generated OpenAPI specs

* Add data schema for GroupMemberCollectionEnd

* resolve review comments

* fix review comments

* change type for "nt", "kt"

* do not handle required/optional field for dataclass from FieldDom

* fix lint error

* fix cover tests

* update specing test

* update and use new openapi utils

* update kt, nt field: allow string or array of strings or array of array of strings

* update openapi spec

* fix lints

* resolve review comments

* resolve conflicts, fix lints and update spec test

* Migrate from setuptools to uv depdendency management

* pin uv version to avoid breaking in the future

* simplify config

* fix python install

* fix: renaming identifier can overwrite other identifiers with same name WebOfTrust#322 (WebOfTrust#392)

* fix: use exn.rp field as recipient for exchange message (#3)

* fix: agent config not picked up from parameters

When agent URLs where only provided through parameters (from env
variables), the "dt" field was not set, which caused keripy to ignore
the configuration. This PR ensure that "dt" field is set.

* Revert "fix: KERIA server exits (exit code 1) on admit call with 'NoneType' object has no attribute 'ked' (WebOfTrust#379)"

This reverts commit 47e424b.

* uv sync

---------

Signed-off-by: Kevin Griffin <griffin.kev@gmail.com>
Co-authored-by: Fergal <fergaloconnor1998@gmail.com>
Co-authored-by: Kent Bull <kent@kentbull.com>
Co-authored-by: Kevin Griffin <griffin.kev@gmail.com>
Co-authored-by: Sotatek-Patrick-Vu <patrick.vu@sotatek.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants