wakatime / wakatime-cli

Command line interface used by all WakaTime text editor plugins
https://wakatime.com/plugins
BSD 3-Clause "New" or "Revised" License
283 stars 41 forks source link

Add Support for project-level Config Files #884

Open theAkito opened 1 year ago

theAkito commented 1 year ago

Basically, project_api_key, but with api_url. For example, project_api_url.

The above is the simple & quick solution for one bigger problem. The ideal solution for all problems on the other hand would be each project having its own optional configuration file, overwriting settings from the global file. So, if the project file has a different api_url only that one gets overriden.

We already may use a .wakatime-project, so why not actually making it work (or simply adding a normal .wakatime in the project directory)?

alanhamlett commented 1 year ago

Project-specific.wakatime files would be nice. We would look up the parent folder tree for a file named .wakatime, making sure to exclude any folders with that name because one always exists at ~/.wakatime/, and have those project configs overwrite the global ~/.wakatime.cfg configs. We need to name it .wakatime without .cfg so it doesn't confuse the global ~/.wakatime.cfg file for a project config.