Skip to content

Code Quality Issues in application.py: Type hint error and string formatting issues #2430

Closed as not planned

Description

@Sayeem3051

Description

Summary

Found multiple code quality issues in src/vorta/application.py that need to be addressed.

Issues Found

1. Parameter Naming Error

Location: react_to_log() method (around line 370)
Issue: Parameter is named mgs but should be msg

def react_to_log(self, mgs, context):  # Should be 'msg' not 'mgs'

2. Incomplete String Handling in bootstrap_profile()

Location: bootstrap_profile() method (around line 420-427)
Issue: String formatting has improper concatenation with the message "Consider removing or repairing this file to 'get rid of this message.'" The string uses both single quotes inside single quotes and should be properly escaped or use different quoting.

3. Missing Repository Name in Error Message

Location: check_failed_response() method (around line 460)
Issue: Error message references "repo %s failed" but the format string doesn't always provide the repo URL context properly.

4. Dead Code After Return Statement

Location: bootstrap_profile() method
Issue: Code after the return statement in the exception handler may not execute as expected.

Steps to Reproduce

  1. Review the src/vorta/application.py file
  2. Check the methods mentioned above
  3. Run linting tools (ruff, mypy) to identify the issues

Expected Result

All code should follow PEP 8 conventions and type hints should be correct.

Actual Result

Parameters have typos, string formatting is incorrect, and some dead code exists.

Suggested Fix

  1. Rename mgs parameter to msg in react_to_log() method
  2. Fix the string concatenation in bootstrap_profile() method
  3. Review error message formatting in check_failed_response()
  4. Remove or reorganize dead code after return statements

Reproduction

  • I tried to reproduce the issue.
  • I was able to reproduce the issue.

OS

Linux (Ubuntu 22.04)

Version of Vorta

v0.11.3

What did you install Vorta with?

Homebrew

Version of Borg

No response

Logs

Activity

  1. m3nu commented on Mar 15, 2026

    @m3nu
    Contributor

    This would be a decent first issue last year. This year, and since you rely on AI tools, I would expect you to work on something more challenging than fixing spelling errors.

  2. Sayeem3051 commented on Mar 15, 2026

    @Sayeem3051
    Author

    Thanks for the feedback! I appreciate the perspective. You're right that AI tools can help with routine fixes, but I'd argue that even "simple" issues like these are valuable:

    1. Code quality compounds - Small typos and formatting issues can accumulate and make the codebase harder to maintain
    2. Good practice - Contributing fixes (even small ones) helps me understand the codebase structure, testing workflow, and contribution process
    3. Type safety matters - The parameter naming issue (mgs vs msg) could lead to subtle bugs if someone relies on autocomplete

    That said, I'm definitely interested in tackling more complex issues too. I'm currently learning about [mention relevant skills from your bio], and I'd be happy to work on issues related to [architecture improvements, performance optimization, feature implementation, etc.] if you have recommendations.

    Would you mind pointing me toward some of the more challenging open issues? I want to make meaningful contributions while still growing my skills.

  3. added 2 commits that reference this issue on Apr 9, 2026
    5c81b8e
    305023a
  4. m3nu commented on Oct 15, 2026

    @m3nu
    Contributor

    Closing, per the discussion above. These nits aren't worth a dedicated change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions