Skip to content

style: apply ignition-devs styleguide#23

Merged
cesarcoatl merged 1 commit into8.3from
style/ignition-devs-style
Apr 17, 2026
Merged

style: apply ignition-devs styleguide#23
cesarcoatl merged 1 commit into8.3from
style/ignition-devs-style

Conversation

@cesarcoatl
Copy link
Copy Markdown
Member

@cesarcoatl cesarcoatl commented Apr 17, 2026

Summary by Sourcery

Apply project-wide tooling and configuration style updates across tox, Sourcery, pre-commit, mypy, and stub packaging configs.

Enhancements:

  • Standardize dependency and tool argument formatting in tox and pre-commit configurations.
  • Align flake8, docformatter, pydocstyle, and mypy settings with the current project style and stricter type-checking defaults.
  • Update stub package pyproject configuration to modern setuptools metadata and package-data declarations.
  • Reformat Sourcery configuration and extend ignore paths and proxy settings for consistency and broader tooling coverage.

Chores:

  • Remove redundant style-related tox environments now covered by pre-commit hooks.
  • Add changelog and license files under stubs to mirror top-level project metadata.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 17, 2026

Reviewer's Guide

Applies the ignition-devs styleguide across configuration files by normalizing dependency syntax, simplifying or removing redundant tox environments, tightening mypy settings, aligning pre-commit hook arguments with the styleguide, updating Sourcery and setuptools config formats, and syncing stubs metadata and licensing layout with the main package.

File-Level Changes

Change Details Files
Normalize tooling configuration to match the styleguide and current tool expectations.
  • Adjusted dependency spec syntax in tox environments (spaces around @) and removed unused style/pip-compile testenvs in both main and stubs tox configs.
  • Reordered and deduplicated options in docformatter, flake8, and pydocstyle sections to match preferred styleguide ordering.
  • Simplified mypy configuration: set mypy_path relative to src, enabled strict mode for stubs, and dropped environment-variable-based path usage.
tox.ini
stubs/tox.ini
.mypy.ini
stubs/.mypy.ini
Align pre-commit hooks and static analysis configs with standardized argument and YAML formatting conventions.
  • Normalized pre-commit hook args to use --flag=value form and adjusted configuration for isort, flake8, and pydocstyle hooks to reference tox configs consistently.
  • Added explicit hook name for sort-all and removed redundant isort repo by consolidating configuration into a single repo entry.
  • Reformatted .sourcery.yaml to match styleguide indentation, compact list syntax for enable/disable sections, updated ignore list, added empty rules block, and introduced proxy configuration.
.pre-commit-config.yaml
.sourcery.yaml
Update stubs package metadata and layout to follow current setuptools and project conventions.
  • Bumped setuptools build requirement to a minimum version supporting modern configuration and slightly adjusted project description.
  • Collapsed setuptools package-data settings into the main [tool.setuptools] table using inline table syntax instead of a separate section.
  • Added stubs-side CHANGELOG and LICENSE files that reference or duplicate the top-level project artifacts for distribution completeness.
stubs/pyproject.toml
stubs/CHANGELOG.md
stubs/LICENSE
Apply repository-wide styleguide-aligned defaults for editor, devcontainer, gitignore, license, and setup script.
  • Updated devcontainer, editorconfig, gitignore, LICENSE, and setup.py files to match ignition-devs styleguide defaults (content changes not shown in diff snippet but implied by touched files).
.devcontainer.json
.editorconfig
.gitignore
LICENSE
setup.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".mypy.ini" line_range="3" />
<code_context>
 [mypy]
 python_version = 2.7
-mypy_path = $MYPY_CONFIG_FILE_DIR/src
+mypy_path = src
 strict = true
 enable_error_code = ignore-without-code
</code_context>
<issue_to_address>
**issue (bug_risk):** Changing `mypy_path` to a relative path may break setups that rely on config-relative resolution.

Using `mypy_path = src` makes resolution depend on the current working directory rather than the config file location, so running mypy from other directories (IDEs, CI, pre-commit) may fail to resolve imports. If you want consistent behavior across environments, prefer keeping `$MYPY_CONFIG_FILE_DIR/src` or an equivalent config-relative path.
</issue_to_address>

### Comment 2
<location path="stubs/.mypy.ini" line_range="3" />
<code_context>
 [mypy]
 python_version = 2.7
-mypy_path = stubs
+strict = true
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Dropping `mypy_path = stubs` may affect how stub modules are discovered depending on where mypy is run from.

Without `mypy_path`, mypy won’t automatically include the `stubs` directory unless it’s run from that directory, which may change which modules it can type-check or cause import errors when run from the repo root or elsewhere. If you depend on config-relative stub resolution, keep `mypy_path = stubs` in addition to `strict = true`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread .mypy.ini
@@ -1,5 +1,5 @@
[mypy]
python_version = 2.7
mypy_path = $MYPY_CONFIG_FILE_DIR/src
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): Changing mypy_path to a relative path may break setups that rely on config-relative resolution.

Using mypy_path = src makes resolution depend on the current working directory rather than the config file location, so running mypy from other directories (IDEs, CI, pre-commit) may fail to resolve imports. If you want consistent behavior across environments, prefer keeping $MYPY_CONFIG_FILE_DIR/src or an equivalent config-relative path.

Comment thread stubs/.mypy.ini
@@ -1,3 +1,3 @@
[mypy]
python_version = 2.7
mypy_path = stubs
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (bug_risk): Dropping mypy_path = stubs may affect how stub modules are discovered depending on where mypy is run from.

Without mypy_path, mypy won’t automatically include the stubs directory unless it’s run from that directory, which may change which modules it can type-check or cause import errors when run from the repo root or elsewhere. If you depend on config-relative stub resolution, keep mypy_path = stubs in addition to strict = true.

@cesarcoatl cesarcoatl merged commit a3d7bcf into 8.3 Apr 17, 2026
5 checks passed
@cesarcoatl cesarcoatl deleted the style/ignition-devs-style branch April 17, 2026 02:01
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.

1 participant