From 74691939c02fc0f16ae7552bf6b8cc786f71487a Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Tue, 3 Mar 2020 11:14:51 +0100 Subject: [PATCH 1/2] Adding script to read out users environment, useful when user creates issues. Adding .github folder with templates for issues and Pull Requests. --- .github/ISSUE_TEMPLATE/BUG_REPORT.md | 40 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md | 15 +++++++++ .github/ISSUE_TEMPLATE/QUESTION.md | 18 ++++++++++ .github/ISSUE_TEMPLATE/REGRESSION.md | 33 +++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 21 ++++++++++++ Scripts/environment.sh | 36 ++++++++++++++++++++ 6 files changed, 163 insertions(+) create mode 100755 .github/ISSUE_TEMPLATE/BUG_REPORT.md create mode 100755 .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md create mode 100755 .github/ISSUE_TEMPLATE/QUESTION.md create mode 100755 .github/ISSUE_TEMPLATE/REGRESSION.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100755 Scripts/environment.sh diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/.github/ISSUE_TEMPLATE/BUG_REPORT.md new file mode 100755 index 000000000..c6379f11a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.md @@ -0,0 +1,40 @@ +--- +name: 🐛 Bug Report +about: If something isn't working as expected + +--- + + + +### New Issue Checklist + +- [ ] I'm using the latest version of Swift Argument Parser (master branch) +- [ ] I read the [Contribution Guidelines](https://github.com/apple/swift-argument-parser/blob/master/CONTRIBUTING.md) +- [ ] I searched for [existing GitHub issues](https://github.com/apple/swift-argument-parser/issues) + +### Expected behavior +_[what you expected to happen]_ + +### Actual behavior +_[what actually happened]_ + +### Steps to reproduce + +1. ... +2. ... + +### If possible, minimal yet complete reproducer code (or URL to code) + +_[anything to help us reproducing the issue]_ + +### Swift Argument Parser version/commit hash + +_[the Swift Argument Parser tag/commit hash]_ + +### Environment + +Stand in the root of the repo and run `./Scripts/environments.sh` and paste the output below + +
+
PLEASE_REPLACE_THIS_STIRNG_WITH_OUTPUT_OF_script_environments_THAT_IS_IN_YOUR_PASTEBOARD
+
diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md new file mode 100755 index 000000000..917a00729 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md @@ -0,0 +1,15 @@ +--- +name: 💡 Feature Request +about: A suggestion for a new feature + +--- + +### New API Proposal: + +#### Motivation: + + + +#### Importance: + + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/QUESTION.md b/.github/ISSUE_TEMPLATE/QUESTION.md new file mode 100755 index 000000000..2bfa0cebc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/QUESTION.md @@ -0,0 +1,18 @@ +--- +name: ❓ Support Question +about: Not sure how something works or how to implement some functionality? Ask us here! (But please check the docs first) + +--- + +### Question Checklist + +- [ ] I'm using the latest version of Swift Argument Parser (master branch) +- [ ] I read the [Contribution Guidelines](https://github.com/apple/swift-argument-parser/blob/master/CONTRIBUTING.md) +- [ ] I searched for [existing GitHub issues](https://github.com/apple/swift-argument-parser/issues) + +### Question Subject + + + +#### Question Description + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/REGRESSION.md b/.github/ISSUE_TEMPLATE/REGRESSION.md new file mode 100755 index 000000000..a33d33b18 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/REGRESSION.md @@ -0,0 +1,33 @@ +--- +name: 😱 Regression +about: If a recent release broke a feature (Please make sure you know the last known working release version) + +--- + + + +### New Regression Checklist + +- [ ] I'm using the latest version of Swift Argument Parser (master branch) +- [ ] I read the [Contribution Guidelines](https://github.com/apple/swift-argument-parser/blob/master/CONTRIBUTING.md) +- [ ] I searched for [existing GitHub issues](https://github.com/apple/swift-argument-parser/issues) + +### Regression Information + +- Breaking version: [e.g. `2.x.x`] +- Last working version: [e.g. `2.x.x`] + +### Regression Description + + +### Swift Argument Parser version/commit hash + +_[the Swift Argument Parser tag/commit hash]_ + +### Environment + +Stand in the root of the repo and run `./Scripts/environments.sh` and paste the output below + +
+
PLEASE_REPLACE_THIS_STIRNG_WITH_OUTPUT_OF_script_environments_THAT_IS_IN_YOUR_PASTEBOARD
+
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..edb784fce --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ +_[One line description of your change]_ + + + +### Checklist +- [ ] I've run tests to see all new and existing tests pass +- [ ] I've followed the code style of the rest of the project +- [ ] I've read the [Contribution Guidelines](CONTRIBUTING.md) +- [ ] I've updated the documentation if necessary + +### Motivation: + +_[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]_ + +### Modifications: + +_[Describe the modifications you've done.]_ + +### Result: + +_[After your change, what will change.]_ \ No newline at end of file diff --git a/Scripts/environment.sh b/Scripts/environment.sh new file mode 100755 index 000000000..ed244e508 --- /dev/null +++ b/Scripts/environment.sh @@ -0,0 +1,36 @@ +#!/bin/bash +##===----------------------------------------------------------------------===## +## +## This source file is part of the Swift Argument Parser open source project +## +## Copyright (c) 2020 Apple Inc. and the Swift project authors +## Licensed under Apache License v2.0 with Runtime Library Exception +## +## See https://swift.org/LICENSE.txt for license information +## +##===----------------------------------------------------------------------===## + +read -p "This will replace your current pasteboard. Continue? [y/n]" -n 1 -r +echo # (optional) move to a new line +if [[ $REPLY =~ ^[Yy]$ ]] +then + swiftversion=$(swift --version) + unix_version_name=$(uname -a | tr ";" '\n') + i="${i}Swift version: ${swiftversion}\n" + i="${i}Unix version: ${unix_version_name}\n" + + # Check if OS is macOS, if so retrieve which version and Xcode version. + if [[ "$OSTYPE" == "darwin"* ]]; then + macos=$(defaults read loginwindow SystemVersionStampAsString | cat -) + xcodebuild_version=$(/usr/bin/xcodebuild -version | grep Xcode) + xcodebuild_build=$(/usr/bin/xcodebuild -version | grep Build) + xcodeselectpath=$(xcode-select -p | cat -) + + i="${i}\nmacOS version: ${macos}\n" + i="${i}Xcode-select path: '${xcodeselectpath}\n" + i="${i}Xcode: ${xcodebuild_version} (${xcodebuild_build})" + fi + + echo -e "${i}" | pbcopy + echo "Your pasteboard now contains debug info, paste it on Github" +fi \ No newline at end of file From 729232d90c77d2a84a229c50512afe823b0472d0 Mon Sep 17 00:00:00 2001 From: Nate Cook Date: Thu, 5 Mar 2020 12:25:55 -0600 Subject: [PATCH 2/2] Streamline the issue and pull request templates a bit --- .github/ISSUE_TEMPLATE/BUG_REPORT.md | 51 ++++++++++------------- .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md | 14 +++---- .github/ISSUE_TEMPLATE/QUESTION.md | 18 -------- .github/ISSUE_TEMPLATE/REGRESSION.md | 33 --------------- .github/ISSUE_TEMPLATE/config.yml | 5 +++ .github/PULL_REQUEST_TEMPLATE.md | 30 ++++++------- .github/PULL_REQUEST_TEMPLATE/NEW.md | 36 ++++++++++++++++ 7 files changed, 84 insertions(+), 103 deletions(-) delete mode 100755 .github/ISSUE_TEMPLATE/QUESTION.md delete mode 100755 .github/ISSUE_TEMPLATE/REGRESSION.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE/NEW.md diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/.github/ISSUE_TEMPLATE/BUG_REPORT.md index c6379f11a..9d0210095 100755 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT.md +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.md @@ -1,40 +1,33 @@ --- name: 🐛 Bug Report -about: If something isn't working as expected - +about: Something isn't working as expected --- - - -### New Issue Checklist - -- [ ] I'm using the latest version of Swift Argument Parser (master branch) -- [ ] I read the [Contribution Guidelines](https://github.com/apple/swift-argument-parser/blob/master/CONTRIBUTING.md) -- [ ] I searched for [existing GitHub issues](https://github.com/apple/swift-argument-parser/issues) + -### Steps to reproduce +Replace this paragraph with a short description of the incorrect incorrect behavior. If this is a regression, please note the last version that the behavior was correct in addition to your current version. -1. ... -2. ... +**ArgumentParser version:** `0.1.0` or the `master` branch, for example. +**Swift version:** Paste the output of `swift --version` here. -### If possible, minimal yet complete reproducer code (or URL to code) +### Checklist +- [ ] If possible, I've reproduced the issue using the `master` branch of this package +- [ ] I've searched for [existing GitHub issues](https://github.com/apple/swift-argument-parser/issues) -_[anything to help us reproducing the issue]_ +### Steps to Reproduce +Replace this paragraph with an explanation of how to reproduce the incorrect behavior. This could include a code listing for a reduced version of your command, or a link to the code that is exhibiting the issue. -### Swift Argument Parser version/commit hash - -_[the Swift Argument Parser tag/commit hash]_ - -### Environment - -Stand in the root of the repo and run `./Scripts/environments.sh` and paste the output below +### Expected behavior +Describe what you expect to happen. -
-
PLEASE_REPLACE_THIS_STIRNG_WITH_OUTPUT_OF_script_environments_THAT_IS_IN_YOUR_PASTEBOARD
-
+### Actual behavior +Describe or copy/paste the behavior you observe. diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md index 917a00729..dcd28fa11 100755 --- a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md @@ -1,15 +1,13 @@ --- name: 💡 Feature Request about: A suggestion for a new feature - --- -### New API Proposal: - -#### Motivation: - - + - \ No newline at end of file +Replace this paragraph with a description of your proposed feature. Code samples that show what's missing, or what new capabilities will be possible, are very helpful! Provide links to existing issues or external references/discussions, if appropriate. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/QUESTION.md b/.github/ISSUE_TEMPLATE/QUESTION.md deleted file mode 100755 index 2bfa0cebc..000000000 --- a/.github/ISSUE_TEMPLATE/QUESTION.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -name: ❓ Support Question -about: Not sure how something works or how to implement some functionality? Ask us here! (But please check the docs first) - ---- - -### Question Checklist - -- [ ] I'm using the latest version of Swift Argument Parser (master branch) -- [ ] I read the [Contribution Guidelines](https://github.com/apple/swift-argument-parser/blob/master/CONTRIBUTING.md) -- [ ] I searched for [existing GitHub issues](https://github.com/apple/swift-argument-parser/issues) - -### Question Subject - - - -#### Question Description - \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/REGRESSION.md b/.github/ISSUE_TEMPLATE/REGRESSION.md deleted file mode 100755 index a33d33b18..000000000 --- a/.github/ISSUE_TEMPLATE/REGRESSION.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -name: 😱 Regression -about: If a recent release broke a feature (Please make sure you know the last known working release version) - ---- - - - -### New Regression Checklist - -- [ ] I'm using the latest version of Swift Argument Parser (master branch) -- [ ] I read the [Contribution Guidelines](https://github.com/apple/swift-argument-parser/blob/master/CONTRIBUTING.md) -- [ ] I searched for [existing GitHub issues](https://github.com/apple/swift-argument-parser/issues) - -### Regression Information - -- Breaking version: [e.g. `2.x.x`] -- Last working version: [e.g. `2.x.x`] - -### Regression Description - - -### Swift Argument Parser version/commit hash - -_[the Swift Argument Parser tag/commit hash]_ - -### Environment - -Stand in the root of the repo and run `./Scripts/environments.sh` and paste the output below - -
-
PLEASE_REPLACE_THIS_STIRNG_WITH_OUTPUT_OF_script_environments_THAT_IS_IN_YOUR_PASTEBOARD
-
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..963525d17 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: ❓ Discussion Forum + url: https://forums.swift.org/c/related-projects/argumentparser/60 + about: Questions about using Swift Argument Parser? Ask here! diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index edb784fce..fac09ad1e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,21 +1,21 @@ -_[One line description of your change]_ + + If this pull request adds new API, please add '?template=new.md' + to the URL to switch to the appropriate template. + + Before you submit your request, please replace the paragraph + below with the relevant details, and complete the steps in the + checklist by placing an 'x' in each box: + + - [x] I've completed this task + - [ ] This task isn't completed +--> + +Replace this paragraph with a description of your changes and rationale. Provide links to an existing issue or external references/discussions, if appropriate. ### Checklist -- [ ] I've run tests to see all new and existing tests pass +- [ ] I've added at least one test that validates that my change is working, if appropriate - [ ] I've followed the code style of the rest of the project - [ ] I've read the [Contribution Guidelines](CONTRIBUTING.md) - [ ] I've updated the documentation if necessary - -### Motivation: - -_[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]_ - -### Modifications: - -_[Describe the modifications you've done.]_ - -### Result: - -_[After your change, what will change.]_ \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/NEW.md b/.github/PULL_REQUEST_TEMPLATE/NEW.md new file mode 100644 index 000000000..dfbd6323c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/NEW.md @@ -0,0 +1,36 @@ + + +### Description +Replace this paragraph with a description of your changes and rationale. Provide links to an existing issue or external references/discussions, if appropriate. + +### Detailed Design +Include any additional information about the design here. At minimum, show any new API: + +```swift +/// The new feature implemented by this pull request. +struct NewFeature {} +``` + +### Documentation Plan +How has the new feature been documented? Have the relevant portions of the guide been updated in addition to symbol-level documentation? + +### Test Plan +How is the new feature tested? + +### Source Impact +What is the impact of this change on existing users? Does it deprecate or remove any existing API? + +### Checklist +- [ ] I've added at least one test that validates that my change is working, if appropriate +- [ ] I've followed the code style of the rest of the project +- [ ] I've read the [Contribution Guidelines](CONTRIBUTING.md) +- [ ] I've updated the documentation if necessary