Skip to content

Create CONTRIBUTING guidelines #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Contributing Guide
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I straight up just moved out what was in the README


Thank you for your interest in contributing.

## Developing

Depending on your needs, you may have one of two development paths:

- via integrating with an existing usage (ideal for modifying the interface of our rules)
- via unit testing (ideal for adding a new rule)

For that reason we've included two paths to develop. Feel free to use either, or both.

### Behavioral troubleshooting

It may be useful to work on this in tandem with a codebase that uses the rules. In that case, we encourage improving local development experience by leveraging `npm link` functionality:

1. In this repository on your machine, create the symlink to your local development directory

```bash
npm link
npm ls @github/markdownlint-github # should show a symlink
```

2. In the codebase you want to test against, replace the package in your `node_modules` folder with the symlink reference

```bash
cd ../your-codebase
npm link @github/markdownlint-github
```

If you go to the `node_modules` directory in your codebase and try to navigate into the package, you'll notice that whatever changes you make in your local development directory will be reflected in the codebase.

3. Reset symlinks at any time by reversing the steps via `npm unlink`.
- in your codebase: `npm unlink @github/markdownlint-github`
- in this directory: `npm unlink`

### Unit and Interface Testing

We use `jest` tests as well, which should be an equally comfortable development experience. Refer to existing test files for any patterns you may find useful.

## Publishing

To publish, merge your work to main (after PR process completed).

Manage version and publish on a new branch, and create a PR to merge these changes into main.

```bash
npm version [major|minor|patch] # alternatively, manage version in package.json
npm run publish
```
48 changes: 2 additions & 46 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,50 +72,6 @@ and your lint script will also need to pass in the location of the custom rule f

Consider upstreaming any rules you find useful as proposals to this repository.

## Development
## Contributing

Depending on your needs, you may have one of two development paths:

- via integrating with an existing usage (ideal for modifying the interface of our rules)
- via unit testing (ideal for adding a new rule)

For that reason we've included two paths to develop. Feel free to use either, or both.

### Behavioral troubleshooting

It may be useful to work on this in tandem with a codebase that uses the rules. In that case, we encourage improving local development experience by leveraging `npm link` functionality:

1. In this repository on your machine, create the symlink to your local development directory

```bash
npm link
npm ls @github/markdownlint-github # should show a symlink
```

2. In the codebase you want to test against, replace the package in your `node_modules` folder with the symlink reference

```bash
cd ../your-codebase
npm link @github/markdownlint-github
```

If you go to the `node_modules` directory in your codebase and try to navigate into the package, you'll notice that whatever changes you make in your local development directory will be reflected in the codebase.

3. Reset symlinks at any time by reversing the steps via `npm unlink`.
- in your codebase: `npm unlink @github/markdownlint-github`
- in this directory: `npm unlink`

### Unit and Interface Testing

We use `jest` tests as well, which should be an equally comfortable development experience. Refer to existing test files for any patterns you may find useful.

## Publishing

To publish, merge your work to main (after PR process completed).

Manage version and publish on a new branch, and create a PR to merge these changes into main.

```bash
npm version [major|minor|patch] # alternatively, manage version in package.json
npm run publish
```
Please read [Contributing Guide](./CONTRIBUTING.md) for more information.