dadadel / pyment

Format and convert Python docstrings and generates patches
GNU General Public License v3.0
905 stars 62 forks source link

pyment doesn't use my pyment.conf if I don't tell it to do so #29

Closed choucavalier closed 3 years ago

choucavalier commented 7 years ago

When running pyment from the root of my directory which contains the following pyment.conf file

first_line = true
quotes = '''
output_style = numpydoc
input_style = numpydoc
init2class = true

pyment uses the default settings instead.

I don't know if this is expected behavior. On my side I was expecting pyment to look for a pyment.conf in the current directory, because that's what most programs do when they have a configuration file.

I can submit a PR that does that if it helps!

dadadel commented 7 years ago

Are you still concerned by that problem @tgy? I cannot reproduce it.

choucavalier commented 7 years ago

@dadadel yes, from what I read in the code, if no config file is provided pyment will not try to look for a pyment.conf config file instead, even though it exists. Maybe I am missing something?

dadadel commented 7 years ago

Ow! Sorry I didn't get it! Indeed @tgy, Pyment won't take into account any configuration file unless it is specified using the appropriate option on the command line. By default, Pyment uses hardcoded default values.

dadadel commented 7 years ago

So, we can consider there is no issue, can't we?

choucavalier commented 7 years ago

What I was saying was that Pyment could use the hardcoded string default_config_file = 'pyment.conf' to check if os.path.isfile(default_config_file) returns True and load the config file if that's the case. If this is against your view of what Pyment should be doing you can close the issue.

There is no "issue" here, it's a feature request!

dadadel commented 7 years ago

Why not @tgy! You can propose a PR if you want.

dadadel commented 7 years ago

@tgy ^

dadadel commented 3 years ago

I close this issue. Pyment need to explicitly provide the configuration file. I think it is better to do so. But feel free to propose a PR if you think it would be better.