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

Added more options to config file (spaces, line length and safety checks) #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

geugenm
Copy link

@geugenm geugenm commented Jan 18, 2025

This PR adds configuration file support for formatting options that were previously only available via command line.

Added Configuration Options:

  • line_length: Controls maximum line length
  • use_spaces: Controls indentation type (spaces vs tabs)
  • safety_checks: Controls parse tree validation and formatting stability checks

Priority Logic:
Command line arguments still take precedence over config file settings, maintaining backward compatibility while adding configuration flexibility.

Example Configuration:

# Core formatting options
line_length: 100
use_spaces: true
safety_checks: true

# Existing options remain unchanged
excluded_directories: !!set
  .git: null
  addons: null

Changes:

  • Updated main function to respect config-based settings with proper fallbacks
  • Maintained existing CLI argument priority over config values
  • Small reformatting of imports, sorted them alphabetically (used python black formatter)

The changes are minimal and focused solely on moving three existing CLI-only options into the configuration file system.

@geugenm
Copy link
Author

geugenm commented Jan 18, 2025

Dedicated issue - #345

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