diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 747801820e..8ed26e04bc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,22 @@ The process for contributions is roughly as follows: * [Sign the Contributor License Agreement](https://www.clahub.com/agreements/chocolatey/choco). * You must do this for each Chocolatey project that requires it. * If you are curious why we would require a CLA, we agree with Julien Ponge - take a look at his [post](https://julien.ponge.org/blog/in-defense-of-contributor-license-agreements/). + * You agree to follow the [etiquette regarding communication](https://github.com/chocolatey/choco#etiquette-regarding-communication). + +### Definition of Trivial Contributions + + +It's hard to define what is a trivial contribution. Sometimes even a 1 character change can be considered significant. Unfortunately because it can be subjective, the decision on what is trivial comes from the committers of the project and not from folks contributing to the project. It is generally safe to assume that you may be subject to signing the [CLA](https://www.clahub.com/agreements/chocolatey/choco) and be prepared to do so. Ask in advance if you are not sure and for reasons are not able to sign the [CLA](https://www.clahub.com/agreements/chocolatey/choco). + +What is generally considered trivial: + +* Fixing a typo +* Documentation changes +* Fixes to non-production code - like fixing something small in the build code. + +What is generally not considered trivial: + + * Changes to any code that would be delivered as part of the final product. This includes any scripts that are delivered, such as PowerShell scripts. Yes, even 1 character changes could be considered non-trivial. ## Contributing Process @@ -21,7 +37,7 @@ The process for contributions is roughly as follows: * Through GitHub, or through the [mailing list](https://groups.google.com/forum/#!forum/chocolatey) (preferred), you talk about a feature you would like to see (or a bug), and why it should be in Chocolatey. * If approved through the mailing list, ensure the accompanying GitHub issue is created with information and a link back to the mailing list discussion. * Once you get a nod from one of the [Chocolatey Team](https://github.com/chocolatey?tab=members), you can start on the feature. - * Alternatively, if a feature is on the issues list with the [Up For Grabs tag](https://github.com/chocolatey/choco/labels/Up%20For%20Grabs), it is open for a patch. You should comment that you are signing up for it on the issue so someone else doesn't also sign up for the work. + * Alternatively, if a feature is on the issues list with the [Up For Grabs](https://github.com/chocolatey/choco/issues?q=is%3Aopen+is%3Aissue+label%3A%22Up+For+Grabs%22) label, it is open for a community member (contributor) to patch. You should comment that you are signing up for it on the issue so someone else doesn't also sign up for the work. ### Set Up Your Environment @@ -46,17 +62,19 @@ A commit should observe the following: * No unnecessary whitespace. Check for whitespace with `git diff --check` and `git diff --cached --check` before commit. * You can stage parts of a file for commit. -A commit message should observe the following: +A commit message should observe the following (based on ["A Note About Git Commit Messages"](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)): * The first line of the commit message should be a short description around 50 characters in length and be prefixed with the GitHub issue it refers to with parentheses surrounding that. If the GitHub issue is #25, you should have `(GH-25)` prefixed to the message. * If the commit is about documentation, the message should be prefixed with `(doc)`. * If it is a trivial commit or one of formatting/spaces fixes, it should be prefixed with `(maint)`. * After the subject, skip one line and fill out a body if the subject line is not informative enough. + * Sometimes you will find that even a tiny code change has a commit body that needs to be very detailed and make take more time to do than the actual change itself! * The body: * Should indent at `72` characters. * Explains more fully the reason(s) for the change and contrasts with previous behavior. * Uses present tense. "Fix" versus "Fixed". + A good example of a commit message is as follows: ``` @@ -80,7 +98,8 @@ Prerequisites: Submitting PR: - * Once you feel it is ready, submit the pull request to the `chocolatey/choco` repository against the ````master```` branch ([more information on this can be found here](https://help.github.com/articles/creating-a-pull-request)). + * Once you feel it is ready, submit the pull request to the `chocolatey/choco` repository against the `master` branch ([more information on this can be found here](https://help.github.com/articles/creating-a-pull-request)) unless specifically requested to submit it against another branch (usually `stable` in these instances). + * In the case of a larger change that is going to require more discussion, please submit a PR sooner. Waiting until you are ready may mean more changes than you are interested in if the changes are taking things in a direction the committers do not want to go. * In the pull request, outline what you did and point to specific conversations (as in URLs) and issues that you are are resolving. This is a tremendous help for us in evaluation and acceptance. * Once the pull request is in, please do not delete the branch or close the pull request (unless something is wrong with it). * One of the Chocolatey Team members, or one of the committers, will evaluate it within a reasonable time period (which is to say usually within 2-4 weeks). Some things get evaluated faster or fast tracked. We are human and we have active lives outside of open source so don't fret if you haven't seen any activity on your pull request within a month or two. We don't have a Service Level Agreement (SLA) for pull requests. Just know that we will evaluate your pull request. diff --git a/README.md b/README.md index 42768462a4..a8c7367ffc 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,13 @@ Come join in the conversation about Chocolatey in our Gitter Chat Room [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/chocolatey/choco?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -Or, you can find us in IRC at #chocolatey. +Or, you can find us in IRC at #chocolatey on freenode. IRC is not as often checked by committers, so it is recommended you stick to Gitter if you need more timely assistance. + +Please make sure you've read over and agree with the [etiquette regarding communication](#etiquette-regarding-communication). + + +## Etiquette Regarding Communication +When requesting support, try to remember that we are all volunteers that have lives outside of open source and none of us are paid to ensure things work for you, so please be considerate of others' time when you are asking for things. Many of us have families that also need time as well and only have so much time to give on a daily basis. In the future we hope that some of us are paid to do this full time and can provide better support when folks are running into issues, but until then a little consideration and patience can go a long way. After all, you are using a pretty good tool without cost. It may not be perfect (yet), and we know that. ## Information @@ -53,7 +59,9 @@ Prerequisites: * The issue has to do with choco itself and is not a package or website issue. * Please check to see if your issue already exists with a quick search of the issues. Start with one relevant term and then add if you get too many results. - * You are not submitting an Enhancement. Enhancements should observe [CONTRIBUTING](https://github.com/chocolatey/choco/blob/master/CONTRIBUTING.md) guidlines. + * You are not submitting an "Enhancement". Enhancements should observe [CONTRIBUTING](https://github.com/chocolatey/choco/blob/master/CONTRIBUTING.md) guidlines. + * You are not submitting a question - questions are better served as emails or gitter chat questions. + * Please make sure you've read over and agree with the [etiquette regarding communication](#etiquette-regarding-communication). Submitting a ticket: @@ -62,7 +70,7 @@ Submitting a ticket: * choco.exe logs to a file in `$env:ChocolateyInstall\log\`. You can grab the specific log output from there so you don't have to capture or redirect screen output. Please limit the amount included to just the command run (the log is appended to with every command). * Please save the log output in a [gist](https://gist.github.com) (save the file as `log.sh`) and link to the gist from the issue. Feel free to create it as secret so it doesn't fill up against your public gists. Anyone with a direct link can still get to secret gists. If you accidentally include secret information in your gist, please delete it and create a new one (gist history can be seen by anyone) and update the link in the ticket (issue history is not retained except by email - deleting the gist ensures that no one can get to it). Using gists this way also keeps accidental secrets from being shared in the ticket in the first place as well. * We'll need the entire log output from the run, so please don't limit it down to areas you feel are relevant. You may miss some important details we'll need to know. This will help expedite issue triage. - * It's helpful to include the version of choco, the version of the OS, and the version of PowerShell (Posh), but the debug script should capture all of those pieces of information. + * It's helpful to include the version of choco, the version of the OS, and the version of PowerShell (Posh) - the debug script should capture all of those pieces of information. * Include screenshots and/or animated gifs whenever possible, they help show us exactly what the problem is. ## Contributing diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index ab652db687..38bb87cee6 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -425,7 +425,7 @@ private PowerShellExecutionResults run_host(ChocolateyConfiguration config, stri { while (reader.Count > 0) { - host.UI.WriteLine(reader.Read().to_string()); + host.UI.WriteLine(reader.Read().to_string().escape_curly_braces()); } } }; @@ -439,7 +439,7 @@ private PowerShellExecutionResults run_host(ChocolateyConfiguration config, stri { while (reader.Count > 0) { - host.UI.WriteErrorLine(reader.Read().to_string()); + host.UI.WriteErrorLine(reader.Read().to_string().escape_curly_braces()); } } }; diff --git a/src/chocolatey/infrastructure.app/services/RegistryService.cs b/src/chocolatey/infrastructure.app/services/RegistryService.cs index fc19d2ad99..226685633d 100644 --- a/src/chocolatey/infrastructure.app/services/RegistryService.cs +++ b/src/chocolatey/infrastructure.app/services/RegistryService.cs @@ -191,6 +191,12 @@ public void evaluate_keys(RegistryKey key, Registry snapshot) appKey.InstallerType = InstallerType.ServicePack; } + // assume NSIS if we still don't know and we find uninst.exe + if (appKey.InstallerType == InstallerType.Unknown && appKey.UninstallString.to_lower().Contains("uninst.exe")) + { + appKey.InstallerType = InstallerType.Nsis; + } + if (appKey.InstallerType == InstallerType.Unknown && appKey.HasQuietUninstall) { appKey.InstallerType = InstallerType.Custom; diff --git a/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs b/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs index 6e6ee21814..5580c5c1fb 100644 --- a/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs +++ b/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs @@ -63,7 +63,7 @@ public override string ReadLine() public override void Write(string value) { - this.Log().Info(value); + this.Log().Info(value.escape_curly_braces()); //Console.Write(value); } @@ -74,9 +74,7 @@ public override void Write(ConsoleColor foregroundColor, ConsoleColor background System.Console.ForegroundColor = foregroundColor; System.Console.BackgroundColor = backgroundColor; - this.Log().Info(value); - - //Console.Write(value); + this.Log().Info(value.escape_curly_braces()); System.Console.ForegroundColor = originalForegroundColor; System.Console.BackgroundColor = originalBackgroundColor; @@ -94,9 +92,7 @@ public override void WriteLine(ConsoleColor foregroundColor, ConsoleColor backgr System.Console.ForegroundColor = foregroundColor; System.Console.BackgroundColor = backgroundColor; - this.Log().Info(value); - - //Console.Write(value); + this.Log().Info(value.escape_curly_braces()); System.Console.ForegroundColor = originalForegroundColor; System.Console.BackgroundColor = originalBackgroundColor; @@ -104,13 +100,13 @@ public override void WriteLine(ConsoleColor foregroundColor, ConsoleColor backgr public override void WriteLine(string value) { - this.Log().Info(value); + this.Log().Info(value.escape_curly_braces()); } public override void WriteErrorLine(string value) { StandardErrorWritten = true; - this.Log().Error(value); + this.Log().Error(value.escape_curly_braces()); } public override void WriteDebugLine(string message) @@ -127,7 +123,7 @@ public override void WriteProgress(long sourceId, ProgressRecord record) if (!hasLoggedStartProgress) { hasLoggedStartProgress = true; - this.Log().Debug(record.Activity); + this.Log().Debug(record.Activity.escape_curly_braces()); } // http://stackoverflow.com/a/888569/18475 @@ -143,12 +139,12 @@ public override void WriteProgress(long sourceId, ProgressRecord record) public override void WriteVerboseLine(string message) { - this.Log().Info(ChocolateyLoggers.Verbose, "VERBOSE: " + message); + this.Log().Info(ChocolateyLoggers.Verbose, "VERBOSE: " + message.escape_curly_braces()); } public override void WriteWarningLine(string message) { - this.Log().Warn("WARNING: " + message); + this.Log().Warn("WARNING: " + message.escape_curly_braces()); } public override Dictionary Prompt(string caption, string message, Collection descriptions) @@ -201,7 +197,7 @@ private static string[] get_hotkey_and_label(string input) public override int PromptForChoice(string caption, string message, Collection choices, int defaultChoice) { - this.Log().Warn(caption); + this.Log().Warn(caption.escape_curly_braces()); string[,] promptData = build_hotkeys_and_plain_labels(choices);