mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Add CONTRIBUTING.md (fixes #127).
This commit is contained in:
parent
4a1e42d942
commit
3fd3f27169
3 changed files with 60 additions and 2 deletions
47
CONTRIBUTING.MD
Normal file
47
CONTRIBUTING.MD
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# Contributing
|
||||
|
||||
Interested in contributing? Great! Here are some suggestions to make it a good experience:
|
||||
|
||||
Start by [opening an issue](issues), whether to identify a problem or outline a change.
|
||||
That issue should be used to discuss the situation and agree on a plan of action before writing code or sending a pull request.
|
||||
Maybe the problem isn't really a problem, or maybe there are more things to consider.
|
||||
If so, it's best to realize that before spending time and effort writing code that may not get used.
|
||||
|
||||
Match the coding style of the files you edit.
|
||||
Although everyone has their own preferences and opinions, a pull request is not the right forum to debate them.
|
||||
|
||||
Do not add new [`dependencies` to `package.json`](https://docs.npmjs.com/files/package.json#dependencies).
|
||||
The excellent Markdown parser [markdown-it](https://www.npmjs.com/package/markdown-it) is this project's one and only dependency.
|
||||
|
||||
If developing a new rule, start by creating a [custom rule](doc/CustomRules.md) in its own project.
|
||||
Once written, published, and tested in real world scenarios, open an issue to consider adding it to this project.
|
||||
For rule ideas, see [issues tagged with the `new rule` label](labels/new%20rule).
|
||||
|
||||
Add tests for all new/changed functionality.
|
||||
Test positive and negative scenarios.
|
||||
Try to break the new code now, or else it will get broken later.
|
||||
|
||||
Run tests before sending a pull request via `npm test` in the [usual manner](https://docs.npmjs.com/misc/scripts).
|
||||
Tests should all pass on all platforms.
|
||||
The test runner is [nodeunit](https://www.npmjs.com/package/nodeunit) and test cases are located in `test/markdownlint-test.js`.
|
||||
When running tests, `test/*.md` files are enumerated, linted, and fail if any violations are missing a corresponding `{MD###}` marker in the test file.
|
||||
For example, the line `### Heading {MD001}` is expected to trigger the rule `MD001`.
|
||||
For cases where the marker text can not be present on the same line, the syntax `{MD###:#}` can be used to include a line number.
|
||||
If `some-test.md` needs custom configuration, a `some-test.json` is used to provide a custom `options.config` for that scenario.
|
||||
|
||||
Lint before sending a pull request by running `npm run lint`.
|
||||
There should be no issues.
|
||||
|
||||
Run code coverage before sending a pull request with `npm run test-cover`.
|
||||
Coverage should remain at 100%.
|
||||
|
||||
Pull requests should contain a single commit.
|
||||
If necessary, squash multiple commits before creating the pull request and when making changes.
|
||||
(See [Git Tools - Rewriting History](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) for details.)
|
||||
|
||||
Open pull requests against the `next` branch.
|
||||
That's where the latest changes are staged for the next release.
|
||||
Include the text "(fixes #??)" at the end of the commit message so the pull request will be associated with the relevant issue.
|
||||
Once accepted, the tag `fixed in next` will be added to the issue.
|
||||
When the commit is merged to `master` branch during the release process, the issue will be closed automatically.
|
||||
(See [Closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/) for details.)
|
||||
|
|
@ -679,6 +679,10 @@ For ideas how to integrate `markdownlint` into your workflow, refer to the follo
|
|||
* [TestCafe](https://devexpress.github.io/testcafe/) ([Search repository](https://github.com/DevExpress/testcafe/search?q=markdownlint))
|
||||
* [webpack](https://webpack.js.org/) ([Search repository](https://github.com/webpack/webpack.js.org/search?q=markdownlint))
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
||||
|
||||
## History
|
||||
|
||||
* 0.0.1 - Initial release, includes tests MD001-MD032.
|
||||
|
|
|
|||
|
|
@ -94,7 +94,10 @@ fs.readdirSync("./test").forEach(function forFile(file) {
|
|||
module.exports.projectFiles = function projectFiles(test) {
|
||||
test.expect(2);
|
||||
const options = {
|
||||
"files": [ "README.md" ],
|
||||
"files": [
|
||||
"README.md",
|
||||
"CONTRIBUTING.md"
|
||||
],
|
||||
"noInlineConfig": true,
|
||||
"config": {
|
||||
"MD013": { "line_length": 150 },
|
||||
|
|
@ -103,7 +106,10 @@ module.exports.projectFiles = function projectFiles(test) {
|
|||
};
|
||||
markdownlint(options, function callback(err, actual) {
|
||||
test.ifError(err);
|
||||
const expected = { "README.md": [] };
|
||||
const expected = {
|
||||
"README.md": [],
|
||||
"CONTRIBUTING.md": []
|
||||
};
|
||||
test.deepEqual(actual, expected, "Issue(s) with project files.");
|
||||
test.done();
|
||||
});
|
||||
|
|
@ -930,6 +936,7 @@ module.exports.readmeHeadings = function readmeHeadings(test) {
|
|||
"## Usage",
|
||||
"## Browser",
|
||||
"## Examples",
|
||||
"## Contributing",
|
||||
"## History"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue