wakatime / sublime-wakatime

Sublime Text 2 & 3 plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/sublime-text
BSD 3-Clause "New" or "Revised" License
526 stars 47 forks source link

exclude project #94

Closed raulp closed 2 years ago

raulp commented 5 years ago

Hey guys

I'm running subline on macos. Latest wakatime plugin. Sublime text is version "dev build 3197". No mater what i tried, i seem to not be able to exclude a project from wakatime.

Considering the project name is PROJECT and the folder of the files is /Users/test/code/waka

In the Sublime Wakatime user settings i added: ^PROJECT ^PROJECT$ ^PROJECT* PROJECT Same for waka, with just the name and the full folder path.

Restarted sublime after changes. Still, any file i change, the heartbeat sends these files. I checked the console.log, and i can see all my paths in the exclude ... but somehow not working

Not sure what can it be... Thanks

alanhamlett commented 5 years ago

When passing an array of regex to hide_project_names or exclude config options, the regex should match the absolute file path of files inside the project not the project name. So your ~/.wakatime.cfg file should look like this:

[settings]
api_key = YOURAPIKEY
exclude =
  code/waka/PROJECT/

Then any files inside /Users/test/code/waka/PROJECT/ folder will be excluded and no heartbeats sent.

raulp commented 5 years ago

Hey @alanhamlett Not sure where i read that for sublime, i don't need to add that to the config. I'll give this a try later, will update soon.

raulp commented 5 years ago

hey @alanhamlett I just tried that, but i could still see the files in my dashboard

Here's the screenshot of the config: https://take.ms/1RUqE

Also, i read somewhere that on sublime, wakatime does not use ~/.wakatime.cfg, but the one in the plugins folder of the sublime installation. And i added the full path in the sublime user settings. What's curious is that there is that the default ignore in there looks like:

"ignore": ["^/tmp/", "^/etc/", "^/var/(?!www/).*", "COMMIT_EDITMSG$", "PULLREQ_EDITMSG$", "MERGE_MSG$", "TAG_EDITMSG$"]

So i thought, for sure, adding the full project path in there should work ... but i guess not :)

Any other things i could try? maybe some debug logs?

alanhamlett commented 5 years ago

maybe some debug logs?

Yes, turn on debug mode with "debug": true in your WakaTime.sublime-settings file then run terminal command: tail -f ~/.wakatime.log

If the log file shows those files as being skipped, then it's working. However, if those files that should be excluded are shown as sent with a 201 or 202 success response from the API then it's not excluding them.

i could still see the files in my dashboard

Are these files from past days or new activity from after adding the exclude settings? The client-side config file only affects future coding. To delete past coding use this page: https://wakatime.com/code-delete-tool

raulp commented 5 years ago

@alanhamlett still does not work Here's a screenshot from the log: https://take.ms/sR25M What i did was just update the settings as we talked yesterday, made sure the project was not my wakatime dashboard. Then opened 1 file, edit, save, edit, save... And 1m later, is in the dashboard....

Does that log help you at all? Any other info i can provide?

raulp commented 5 years ago

@alanhamlett any more ideas?

alanhamlett commented 5 years ago

Since this is Sublime, it's the one plugin that uses it's own config file WakaTime.sublime-settings. The ignore config from that file might be overwriting the exclude config from your ~/.wakatime.cfg file.

Does it stop tracking the project when adding it's path to the ignore key in your WakaTime.sublime-settings file?

gandarez commented 2 years ago

Closing due to lack of activity.