Skip to content

Fix PyTA CLI output format behaviour - #1367

Merged
david-yz-liu merged 3 commits into
pyta-uoft:masterfrom
rachelzUT:prioritize-cli-over-config
Jul 18, 2026
Merged

Fix PyTA CLI output format behaviour#1367
david-yz-liu merged 3 commits into
pyta-uoft:masterfrom
rachelzUT:prioritize-cli-over-config

Conversation

@rachelzUT

@rachelzUT rachelzUT commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

Fixed the PythonTA CLI behaviour to prioritze the output format specified by the --output-format flag over the config file's output-format setting.
Previously, any output format specified in the --config file would override the output format specified in the --output-format option. This PR reverses that behaviour.

...

Screenshots of your changes (if applicable)

Type of Change

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue) X
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📚 Documentation update (change that only updates documentation)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • I have updated the project Changelog (this is required for all changes).
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

@coveralls

coveralls commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29631888104

Coverage decreased (-0.1%) to 90.835%

Details

  • Coverage decreased (-0.1%) from the base build.
  • Patch coverage: 6 uncovered changes across 2 files (15 of 21 lines covered, 71.43%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
packages/python-ta/src/python_ta/check/helpers.py 9 5 55.56%
packages/python-ta/src/python_ta/config/init.py 6 4 66.67%
Total (4 files) 21 15 71.43%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4070
Covered Lines: 3697
Line Coverage: 90.84%
Coverage Strength: 17.65 hits per line

💛 - Coveralls

@rachelzUT
rachelzUT requested a review from david-yz-liu July 14, 2026 17:22
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])


def _load_config_as_dict(config_path: str) -> dict[str, str]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This approach is okay but ends up duplicating some logic within the python_ta.config module. I'm going to suggest a more generalizable approach.

Let's add (to the check_all, check_errors, and _check functions) a new pylint_args optional argument, which is a list of command-line arguments that are passed in. These can be passed all the way down to the load_config function; Pylint's internal _config_initialization function expects this list and should use it to override any configuration options.

This is more generalizable in the sense that this should allow arbitrary command-line arguments to be passed to PythonTA's CLI, and then forwarded to pylint. (Future work!)

@rachelzUT
rachelzUT requested a review from david-yz-liu July 18, 2026 05:21

@david-yz-liu david-yz-liu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work, @rachelzUT!

@david-yz-liu
david-yz-liu merged commit 0e32f52 into pyta-uoft:master Jul 18, 2026
30 checks passed
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