mattermost / mattermost-plugin-starter-template

Build scripts and templates for writing Mattermost plugins.
https://developers.mattermost.com/extend/plugins/
Apache License 2.0
129 stars 120 forks source link

Update .gitignore #80

Closed marianunez closed 4 years ago

marianunez commented 4 years ago

Summary

Working on the agenda and custom attributes plugin I noticed that I had to add these entries to .gitignore. These may be useful to include in the template for future plugins.

mickmister commented 4 years ago

FWIW, I use the Jira plugin as a baseline for these sort of things, as it is the currently the most mature plugin (in some ways). Here are the contents of the .gitignore in its repo:

/plugin.exe
/mattermost-jira-plugin.tar.gz
dist
bin
vendor
.npminstall

# Dev
*.code-workspace

# Mac
.DS_Store

# Intellij
.idea/

Surprisingly, neither node_modules nor .vscode are present.

mickmister commented 4 years ago

These additions are fine by me. Maybe check out mattermost-webapp's .gitignore to see if there are any other useful ones?

lieut-data commented 4 years ago

In at least my case, some of these are already hidden via a $HOME/.gitignore_global:

.vscode
*.swo
*.orig
*.swp
.DS_store

The purist in me says we should only include artifacts /from this code/ into .gitignore. Otherwise we have to define every IDE and OS's temp files into every repository's .gitignore, which seems unwieldy. Thoughts about including node_modules only, and perhaps including a comment in .gitignore linking to a recommended .gitignore_global file, such as the ones at https://github.com/github/gitignore?

mickmister commented 4 years ago

@lieut-data I agree. Good call!

marianunez commented 4 years ago

@lieut-data FWIW, webApp also includes these entries in their .gitignore so my proposal was to try to get plugin developers up and running quickly while being consistent with other MM code base.

However, if you feel it will be cleaner leaving it to the developers to setup a global .gitignore I'm good with that too. Will be setting up one myself.

lieut-data commented 4 years ago

@marianunez, that's an excellent counter argument. In fact, I vaguely recall expressing this same opinion a long time ago, and someone sharing https://github.com/kubernetes/kubernetes/blob/master/.gitignore to illustrate that even the biggest players try to make it easy for contributors.

If we decide to keep the expanded list, let's try to clearly distinguish the build artifacts from the "other stuff".