egh / ledger-autosync

Synchronize your ledger-cli files with your bank.
GNU General Public License v3.0
273 stars 42 forks source link

Global Configuration #99

Open kevinjfoley opened 4 years ago

kevinjfoley commented 4 years ago

I was taking a look at implementing the change requested in #97 and while the change itself is very simple, accessing the parameters that controls it is fairly difficult.

I ran into the same issue when implementing #95, of the 62 lines added in that PR, I think 55 or so were updating signatures to pass the new parameter along.

Therefore, I wanted to get opinions on refactoring things to use a config module that's available globally to access parameters. Essentially something along the lines of what is outlined in the Python programming FAQ.

I'd be happy to implement and I don't think it should take too much work, mostly just tedious changes. However I wanted to make sure you're on board for such a change @egh and get your feedback before starting any work. What do you think?

egh commented 4 years ago

Seems completely reasonable. Another option would be to bundle up everything in a config object and pass it along to the methods called, so that the method signature would not need updating every time we added a new parameter.