Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config file support #940

Closed

Commits on Apr 2, 2024

  1. Add ConfigArgParse as a dependency

    ConfigArgParse [1] is "[a] drop-in replacement for argparse that allows options
    to also be set via config files and/or environment variables." We can use it to
    provide config file support while reusing our existing argument parsing code.
    cbouchardseatgeek committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    38254d7 View commit details
    Browse the repository at this point in the history
  2. Replace argparse.ArgumentParser with configargparse.ArgumentParser

    No functional change, but just replace argparse.ArgumentParser with the drop-in
    from configargparse. I've also extracted the parser to a separate function to
    keep it contained.
    cbouchardseatgeek committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    e494f45 View commit details
    Browse the repository at this point in the history
  3. Configure parser to look for config files

    It will look for pyupgrade.toml, falling back to pyproject.toml. In both files,
    it will read the tool.upgrade section.
    cbouchardseatgeek committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    56fc4a2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3c1bfe4 View commit details
    Browse the repository at this point in the history