Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b4787e

Browse files
committed
Improve contribution guidelines
I noticed our changelog link was not working in our CONTRIBUTING.md today, and from there I went on to fix a number of other minor issues. - Fixed broken changelog link in CONTRIBUTING.md. When you are viewing CONTRIBUTING.md, you are already in /blob/ so the extra ../blob/master breaks the link. I decided to just use absolute urls for CONTRIBUTING.md and PULL_REQUEST_TEMPLATE.md to reduce confusion. - Removed unnecessary line breaks (these were sometimes present after 80 characters, sometimes not--now they are consistently absent), whitespace, etc. - Fixed a number of grammatical errors - Improved misc. wording - Added a reference to `bin/build_config` in PULL_REQUEST_TEMPLATE.md
1 parent ab0af51 commit 6b4787e

File tree

3 files changed

+29
-40
lines changed

3 files changed

+29
-40
lines changed

.github/CONTRIBUTING.md

+21-28
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,34 @@
11
# Contributing
22

3-
If you discover issues, have ideas for improvements or new features,
4-
please report them to the [issue tracker][1] of the repository or
5-
submit a pull request. Please, try to follow these guidelines when you
6-
do so.
3+
If you encounter problems or have ideas for improvements or new features, please report them to the [issue tracker](https://github.com/rubocop-rspec/rubocop-rspec/issues) or submit a pull request. Please, try to follow these guidelines when you do so.
74

85
## Issue reporting
96

107
* Check that the issue has not already been reported.
11-
* Check that the issue has not already been fixed in the latest code
12-
(a.k.a. `master`).
8+
* Check that the issue has not already been fixed in the latest code (a.k.a. `master`).
139
* Check if the issue is a non-goal of RuboCop RSpec.
14-
* Be clear, concise and precise in your description of the problem.
15-
* Open an issue with a descriptive title and a summary in grammatically correct,
16-
complete sentences.
17-
* Report the versions of `rubocop-rspec`, as well as the output of `rubocop -V`
10+
* Be clear, concise, and precise in your description of the problem.
11+
* Open an issue with a descriptive title and a summary in grammatically correct, complete sentences.
12+
* Report the versions of `rubocop-rspec`, as well as the output of `rubocop -V`.
1813
* Include any relevant code to the issue summary.
1914

2015
## Pull requests
21-
1. Fork the project.
22-
2. Create a feature branch.
23-
3. Make sure to add tests.
24-
4. Make sure the test suite is passing (run `rake`).
25-
5. Add [Changelog](../blob/master/CHANGELOG.md) entry.
26-
6. Commit your changes.
27-
7. Push to the branch.
28-
8. Create new Pull Request.
16+
17+
1. Fork the project.
18+
2. Create a feature branch.
19+
3. Make sure to add tests.
20+
4. Make sure the test suite passes (run `rake`).
21+
5. Add a [changelog](https://github.com/rubocop-rspec/rubocop-rspec/blob/master/CHANGELOG.md) entry.
22+
6. Commit your changes.
23+
7. Push to the branch.
24+
8. Create new Pull Request.
2925

3026
## Creating new cops
31-
There are some steps you have to follow when you add new cops:
32-
* Add an entry to `config/default.yml`. It's ordered list, make sure to follow the order.
33-
* The description of the cop in the code should match the one in config. `bin/build_config` copies the description from the cop to config.
34-
* The cop should include examples of good and bad code.
35-
* Generate documentation for the cop using `rake generate_cops_documentation`.
36-
* Add tests for as much use cases as you can think of. Always add tests for both code that should be reported and good code that should pass.
37-
* Some common pitfalls:
38-
** If you are writing cop inspecting code outside of an example, check for false positive when similarly named variables are used inside of the example.
39-
** If your cop is inspecting code inside an example, check that it works when the example is empty (empty `describe`, `it`, etc.).
4027

41-
[1]: https://github.com/backus/rubocop-rspec/issues
28+
* Document examples of good and bad code in your cop.
29+
* Add an entry to `config/default.yml`. It's an ordered list, so be sure to insert at the appropriate place.
30+
* Run `bundle exec rake`. This will verify that the build passes as well as generate documentation and ensure that `config/default.yml` is up to date (don't forget to commit the documentation).
31+
* Add tests for as many use cases as you can think of. Always add tests for both bad code that should register an offense and good code that should not.
32+
* Common pitfalls:
33+
* If your cop inspects code outside of an example, check for false positives when similarly named variables are used inside of the example.
34+
* If your cop inspects code inside of an example, check that it works when the example is empty (empty `describe`, `it`, etc.).

.github/PULL_REQUEST_TEMPLATE.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
**Replace this text with a summary of the changes in your PR.
2-
The more detailed you are, the better.**
1+
**Replace this text with a summary of the changes in your PR. The more detailed you are, the better.**
32

4-
-----------------
3+
---
54

65
Before submitting the PR make sure the following are checked:
76

87
* [ ] Feature branch is up-to-date with `master` (if not - rebase it).
98
* [ ] Squashed related commits together.
109
* [ ] Added tests.
11-
* [ ] Updated documentation (run `rake generate_cops_documentation`).
12-
* [ ] Added an entry to the [Changelog](../blob/master/CHANGELOG.md) if the new code introduces user-observable changes.
13-
* [ ] The build (`bundle exec rake`) is passing.
10+
* [ ] Added an entry to the [changelog](https://github.com/rubocop-rspec/rubocop-rspec/blob/master/CHANGELOG.md) if the new code introduces user-observable changes.
11+
* [ ] The build (`bundle exec rake`) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).
1412

1513
If you have created a new cop:
14+
1615
* [ ] Added the new cop to `config/default.yml`.
17-
* [ ] The cop includes examples of good and bad code.
18-
* [ ] You have tests for both code that should be reported and code that is good.
16+
* [ ] The cop documents examples of good and bad code.
17+
* [ ] The tests assert both that bad code is reported and that good code is not reported.

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
RSpec-specific analysis for your projects, as an extension to
1010
[RuboCop](https://github.com/bbatsov/rubocop).
1111

12-
1312
## Installation
1413

1514
Just install the `rubocop-rspec` gem
@@ -24,7 +23,6 @@ or if you use bundler put this in your `Gemfile`
2423
gem 'rubocop-rspec'
2524
```
2625

27-
2826
## Usage
2927

3028
You need to tell RuboCop to load the RSpec extension. There are three
@@ -138,10 +136,9 @@ can be achieved using RSpec's `disable_monkey_patching!` method, which you can r
138136

139137
Before disabling `should` you will need all your specs to use the `expect` syntax. You can use [Transpec](http://yujinakayama.me/transpec/), which will do the conversion for you.
140138

141-
142139
## Contributing
143140

144-
Checkout the [contribution guidelines](.github/CONTRIBUTING.md)
141+
Checkout the [contribution guidelines](.github/CONTRIBUTING.md).
145142

146143
## License
147144

0 commit comments

Comments
 (0)