diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 96a9e7fb687..f4fc9f52341 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -8,7 +8,11 @@ This template is for bug reports. If you are reporting a bug, please continue on Note that leaving sections blank will make it difficult for us to troubleshoot and we may have to close the issue. --> -**What version of ESLint are you using?** +**Tell us about your environment** + +* **ESLint Version:** +* **Node Version:** +* **npm Version:** **What parser (default, Babel-ESLint, etc.) are you using?** diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 075b5007ff3..2eb8e1e0c69 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,16 +1,29 @@ - +*If the item you've check above has a template, please paste the template questions here and answer them.* -**What issue does this pull request address?** +**Please check each item to ensure your pull request is ready:** + +- [ ] I've read the [pull request guide](http://eslint.org/docs/developer-guide/contributing/pull-requests) +- [ ] I've included tests for my change +- [ ] I've updated documentation for my change (if appropriate) + **What changes did you make? (Give an overview)** **Is there anything you'd like reviewers to focus on?** + + diff --git a/docs/developer-guide/contributing/new-rules.md b/docs/developer-guide/contributing/new-rules.md index c5f7ff94e13..9f88d0513fa 100644 --- a/docs/developer-guide/contributing/new-rules.md +++ b/docs/developer-guide/contributing/new-rules.md @@ -19,12 +19,7 @@ Even though these are the formal criteria for inclusion, each rule is evaluated ## Proposing a Rule -If you want to propose a new rule, [create an issue](https://github.com/eslint/eslint/issues/new?body=**When%20does%20this%20rule%20warn%3F%20Please%20describe%20and%20show%20example%20code%3A**%0A%0A**Is%20this%20rule%20preventing%20an%20error%20or%20is%20it%20stylistic%3F**%0A%0A**Why%20is%20this%20rule%20a%20candidate%20for%20inclusion%20instead%20of%20creating%20a%20custom%20rule%3F**%0A%0A**Are%20you%20willing%20to%20create%20the%20rule%20yourself%3F**%0A%0A) be sure to include: - -1. When the rules will warn. Include a description as well as sample code. -1. Whether the rule prevents an error or is stylistic. -1. Why the rule should be in the core instead of creating a custom rule. -1. Are you willing to create the rule yourself? +If you want to propose a new rule, [create a pull request](/docs/developer-guide/contributing/pull-requests) or new issue and paste the questions from the [rule proposal template](https://github.com/eslint/eslint/blob/master/templates/rule-proposal.md) into the description. We need all of this information in order to determine whether or not the rule is a good core rule candidate. diff --git a/docs/developer-guide/contributing/pull-requests.md b/docs/developer-guide/contributing/pull-requests.md index 7134329c576..8f1f2f59804 100644 --- a/docs/developer-guide/contributing/pull-requests.md +++ b/docs/developer-guide/contributing/pull-requests.md @@ -8,8 +8,7 @@ If you'd like to work on a pull request and you've never submitted code before, 1. Sign our [Contributor License Agreement](https://contribute.jquery.org/cla). 1. Set up a [development environment](../development-environment). -1. Ensure there's an issue that describes what you're doing and the issue has been accepted. You can create a new issue or just indicate you're [working on an existing issue](working-on-issues). - * Exception: documentation-only changes do not require an issue. +1. If you want to implement a breaking change or a change to the core, ensure there's an issue that describes what you're doing and the issue has been accepted. You can create a new issue or just indicate you're [working on an existing issue](working-on-issues). Bug fixes, documentation changes, and other pull requests do not require an issue. After that, you're ready to start working on code. @@ -71,7 +70,7 @@ The `Tag` is one of the following: Use the [labels of the issue you are working on](working-on-issues#issue-labels) to determine the best tag. -The message summary should be a one-sentence description of the change, and it must be 72 characters in length or shorter. The issue number should be mentioned at the end. If the commit doesn't completely fix the issue, then use `(refs #1234)` instead of `(fixes #1234)`. +The message summary should be a one-sentence description of the change, and it must be 72 characters in length or shorter. If the pull request addresses an issue, then the issue number should be mentioned at the end. If the commit doesn't completely fix the issue, then use `(refs #1234)` instead of `(fixes #1234)`. Here are some good commit message summary examples: diff --git a/docs/developer-guide/contributing/reporting-bugs.md b/docs/developer-guide/contributing/reporting-bugs.md index 81264e8a659..153dd269519 100644 --- a/docs/developer-guide/contributing/reporting-bugs.md +++ b/docs/developer-guide/contributing/reporting-bugs.md @@ -1,17 +1,6 @@ # Reporting Bugs -If you think you've found a bug in ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new?body=**What%20version%20are%20you%20using%3F**%0A%0A**What%20did%20you%20do%3F**%0A%0A**What%20happened%3F**%0A%0A**What%20did%20you%20expect%20to%20happen%3F**%0A%0A) on GitHub. Be sure to include the following information: - -1. The version of ESLint you are using. -1. What you did. -1. What you expected to happen. -1. What actually happened. - -In addition, if you're reporting a bug with a rule, be sure to include: - -* The actual source code that is causing the issue -* Your configuration -* The complete and actual output from ESLint (don't summarize, we need the raw output) +If you think you've found a bug in ESLint, please [create a new issue](https://github.com/eslint/eslint/issues/new) or a [pull request](/docs/developer-guide/contributing/pull-requests) on GitHub. Be sure to copy the questions from the [bug report template](https://github.com/eslint/eslint/blob/master/templates/bug-report.md). Please include as much detail as possible to help us properly address your issue. If we need to triage issues and constantly ask people for more detail, that's time taken away from actually fixing issues. Help us be as efficient as possible by including a lot of detail in your issues. diff --git a/docs/developer-guide/contributing/rule-changes.md b/docs/developer-guide/contributing/rule-changes.md index 42aa64848ef..8eaa19d1c7a 100644 --- a/docs/developer-guide/contributing/rule-changes.md +++ b/docs/developer-guide/contributing/rule-changes.md @@ -4,12 +4,7 @@ Occasionally, a core ESLint rule needs to be changed. This is not necessarily a ## Proposing a Rule Change -If you want to propose a rule change, [create an issue](https://github.com/eslint/eslint/issues/new?body=**What%20version%20of%20ESLint%20are%20you%20using%3F**%0A%0A**What%20rule%20do%20you%20want%20to%20change%3F**%0A%0A**What%20code%20should%20be%20flagged%20as%20incorrect%20with%20this%20change%3F**%0A%0A**What%20happens%20when%20the%20rule%20is%20applied%20to%20this%20code%20now%3F**%0A%0A%0A) and be sure to include: - -1. The version of ESLint you are using -2. The rule you want to change -3. The code you want to be flagged as incorrect -4. What happens when the rule is applied to the code without your change +To propose a change to an existing rule, [create a new issue](https://github.com/eslint/eslint/issues/new) or a [pull request](/docs/developer-guide/contributing/pull-requests) on GitHub. Be sure to copy the questions from the [rule change proposal template](https://github.com/eslint/eslint/blob/master/templates/rule-change-proposal.md). We need all of this information in order to determine whether or not the change is a good candidate for inclusion. diff --git a/docs/maintainer-guide/pullrequests.md b/docs/maintainer-guide/pullrequests.md index 78be5677e1d..3f3480e4e84 100644 --- a/docs/maintainer-guide/pullrequests.md +++ b/docs/maintainer-guide/pullrequests.md @@ -12,7 +12,6 @@ When a pull request is opened, the bot will check the following: 1. Has the submitter signed a CLA? 1. Is the commit message summary in the correct format? Double-check that the tag ("Fix:", "New:", etc.) is correct based on the issue. Documentation-only pull requests do not require an issue. -1. Is there only one commit in the pull request? 1. Does the commit summary reference an issue? 1. Is the commit summary too long? diff --git a/templates/bug-report.md b/templates/bug-report.md new file mode 100644 index 00000000000..eb64ba73747 --- /dev/null +++ b/templates/bug-report.md @@ -0,0 +1,16 @@ +**Tell us about your environment** + +* **ESLint Version:** +* **Node Version:** +* **npm Version:** + +**What parser (default, Babel-ESLint, etc.) are you using?** + +**Please show your full configuration:** + +**What did you do? Please include the actual source code causing the issue.** + +**What did you expect to happen?** + +**What actually happened? Please include the actual, raw output from ESLint.** + diff --git a/templates/pr-create.md.ejs b/templates/pr-create.md.ejs index 21ac7758943..6c41600a4ee 100644 --- a/templates/pr-create.md.ejs +++ b/templates/pr-create.md.ejs @@ -8,11 +8,6 @@ function isValidCommitFlag(log) { return !!result || log.indexOf("Revert \"") === 0; } -function needsIssueRef(log) { - var result = log.match(ISSUE_REF_PATTERN); - return !result && log.indexOf("Docs:") !== 0; -} - var problems = []; // Check for one commit per pull request @@ -27,10 +22,6 @@ if (meta.commits) { if (log.length > 72) { problems.push("The commit summary must be 72 characters or shorter. Please check out our [guide](http://eslint.org/docs/developer-guide/contributing/pull-requests#step-2-make-your-changes) for how to properly format your commit summary and [update](http://eslint.org/docs/developer-guide/contributing/pull-requests#updating-the-commit-message) it on this pull request."); } - - if (needsIssueRef(log)) { - problems.push("Pull requests with code require an issue to be mentioned at the end of the commit summary, such as `(fixes #1234)`. Please [update](http://eslint.org/docs/developer-guide/contributing/pull-requests#updating-the-commit-message) the commit summary with an issue (file a new issue if one doesn't already exist).") - } } if (problems.length) { %> diff --git a/templates/rule-change-proposal.md b/templates/rule-change-proposal.md new file mode 100644 index 00000000000..689e218a44c --- /dev/null +++ b/templates/rule-change-proposal.md @@ -0,0 +1,19 @@ +**What rule do you want to change?** + + +**Does this change cause the rule to produce more or fewer warnings?** + + +**How will the change be implemented? (New option, new default behavior, etc.)?** + + +**Please provide some example code that this change will affect:** + +```js + +``` + +**What does the rule currently do for this code?** + + +**What will the rule do after it's changed?** diff --git a/templates/rule-proposal.md b/templates/rule-proposal.md new file mode 100644 index 00000000000..658e0eba892 --- /dev/null +++ b/templates/rule-proposal.md @@ -0,0 +1,19 @@ +**Please describe what the rule should do:** + + +**What category of rule is this? (place an "X" next to just one item)** + +``` +[ ] Enforces code style +[ ] Warns about a potential error +[ ] Suggests an alternate way of doing something +[ ] Other (please specify:) +``` + +**Provide 2-3 code examples that this rule will warn about:** + +```js + +``` + +**Why should this rule be included in ESLint (instead of a plugin)?** diff --git a/tests/templates/pr-create.md.ejs.js b/tests/templates/pr-create.md.ejs.js index f8e47b4f665..179eef9a20f 100644 --- a/tests/templates/pr-create.md.ejs.js +++ b/tests/templates/pr-create.md.ejs.js @@ -61,7 +61,6 @@ describe("pr-create.md.ejs", function() { }); assert.ok(result.indexOf("begin with a tag") > -1); - assert.ok(result.indexOf("require an issue") > -1); }); it("should mention commit message length when there's a message longer than 72 characters", function() { @@ -85,7 +84,6 @@ describe("pr-create.md.ejs", function() { }); assert.ok(result.indexOf("72 characters") > -1); - assert.ok(result.indexOf("require an issue") === -1); }); it("should not mention commit message length when there's a multi-line message with first line not over 72 characters", function() { @@ -109,7 +107,6 @@ describe("pr-create.md.ejs", function() { }); assert.equal(result.trim(), "LGTM"); - assert.ok(result.indexOf("require an issue") === -1); }); it("should not mention missing issue when there's one documentation commit", function() { @@ -133,7 +130,6 @@ describe("pr-create.md.ejs", function() { }); assert.equal(result.trim(), "LGTM"); - assert.ok(result.indexOf("require an issue") === -1); }); ["Breaking", "Build", "Chore", "Docs", "Fix", "New", "Update", "Upgrade"].forEach(function(type) { @@ -158,31 +154,7 @@ describe("pr-create.md.ejs", function() { }); assert.equal(result.trim(), "LGTM"); - assert.ok(result.indexOf("require an issue") === -1); }); }); - it("should mention missing issue when there's a missing closing paren", function() { - const result = ejs.render(TEMPLATE_TEXT, { - payload: { - sender: { - login: "nzakas" - }, - commits: 1 - }, - meta: { - cla: true, - commits: [ - { - commit: { - message: "Fix: Foo bar (fixes #1234" - } - } - ] - } - }); - - assert.ok(result.indexOf("require an issue") > -1); - }); - });