Skip to content

Commit

Permalink
fix: switches to standard prettier and eslint and reformat code
Browse files Browse the repository at this point in the history
* docs: fixes contributors shield

* style: removes xo and replaces with standard eslint and prettier and applies rules to 01_bug_report

this is in preparation for switching to jest and migrated to nx

COMPLETES: #211

* test: adds "unused" const back to fix tests

* refactor: move config to files outside of package.json

* Merge branch 'master' of https://github.com/semantic-release-plus/semantic-release into update-from-master

* chore(deps): update dependency p-retry to v4.6.0

* chore(deps): update dependency codecov to v3.8.3

* chore(deps): update dependency sinon to v11.1.2

* Merge branch 'master' of https://github.com/semantic-release-plus/semantic-release into update-from-master

* fix: updates lint-staged conifg

Co-authored-by: Renovate Bot <bot@renovateapp.com>
  • Loading branch information
JoA-MoS and renovate-bot authored Sep 9, 2021
1 parent 6a92e53 commit 20b0c44
Show file tree
Hide file tree
Showing 98 changed files with 6,387 additions and 6,540 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 2018
},
"env": {
"node": true,
"es6": true
},
"rules": {}
}
41 changes: 20 additions & 21 deletions .github/ISSUE_TEMPLATE/01_bug_report.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
---
name: Bug report
about: Something not working as expected

---

## Current behavior

<!-- Describe how the issue manifests. -->

## Expected behavior

<!-- Describe what the desired behavior would be. -->

## Environment

- **semantic-release** version: <!-- Version set in package.json devDpendencies -->
- CI environment: <!-- CI service name -->
- Plugins used: <!-- List semantic-release plugin used if any -->
- **semantic-release** configuration: <!-- link to your repository or relevant part of the semantic-release config -->
- CI logs: <!-- link to your CI logs or semantic-release logs -->
---
name: Bug report
about: Something not working as expected
---

## Current behavior

<!-- Describe how the issue manifests. -->

## Expected behavior

<!-- Describe what the desired behavior would be. -->

## Environment

- **semantic-release** version: <!-- Version set in package.json devDpendencies -->
- CI environment: <!-- CI service name -->
- Plugins used: <!-- List semantic-release plugin used if any -->
- **semantic-release** configuration: <!-- link to your repository or relevant part of the semantic-release config -->
- CI logs: <!-- link to your CI logs or semantic-release logs -->
33 changes: 16 additions & 17 deletions .github/ISSUE_TEMPLATE/02_feature_request.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---
name: Feature request
about: Wouldn’t it be nice if semantic-release could ...

---

## New feature motivation

<!-- Describe the context, the use-case and the advantages of the feature request. -->

## New feature description

<!-- Describe the functional changes that would have to be made in semantic-release or its plugins. -->

## New feature implementation

<!-- Optionally describe the technical changes to be made in semantic-release or its plugins. -->
---
name: Feature request
about: Wouldn’t it be nice if semantic-release could ...
---

## New feature motivation

<!-- Describe the context, the use-case and the advantages of the feature request. -->

## New feature description

<!-- Describe the functional changes that would have to be made in semantic-release or its plugins. -->

## New feature implementation

<!-- Optionally describe the technical changes to be made in semantic-release or its plugins. -->
25 changes: 12 additions & 13 deletions .github/ISSUE_TEMPLATE/03_plugin_suggestion.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
name: New plugin suggestion
about: Integrate with a new platform, etc

---

## New plugin motivation

<!-- Describe the reasons to create a new plugin and why it's not covered by the existing ones. -->

## Third-party documentation

<!-- Provide explanation and documentation links for the platform to integrate with. -->
---
name: New plugin suggestion
about: Integrate with a new platform, etc
---

## New plugin motivation

<!-- Describe the reasons to create a new plugin and why it's not covered by the existing ones. -->

## Third-party documentation

<!-- Provide explanation and documentation links for the platform to integrate with. -->
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- next
- beta
- alpha
- "*.x" # maintenance releases branches
- '*.x' # maintenance releases branches
# renovate/** branches are generated by https://github.com/apps/renovate
- renovate/**

Expand All @@ -28,7 +28,8 @@ jobs:
cache: npm
- run: npm ci
- run: npm run lint

- run: npm run format:check

test:
needs: lint
strategy:
Expand All @@ -49,7 +50,7 @@ jobs:
cache: npm
- run: npm ci
- run: npm run test:ci

release:
name: release
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.js": "eslint --fix",
"*": "prettier --write --ignore-unknown"
}
5 changes: 5 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"include": ["lib/**/*.js", "index.js", "cli.js"],
"reporter": ["json", "text", "html"],
"all": true
}
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Add files here to ignore them from prettier formatting

/dist
/coverage
/.nyc_output
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
File renamed without changes.
10 changes: 1 addition & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
{
"[javascript]": {
"editor.defaultFormatter": "samverschueren.linter-xo"
},
"xo.enable": true,
"xo.format.enable": true,
"editor.formatOnSave": false,
"jira-plugin.workingProject": ""
}
{}
20 changes: 10 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Expand Down
18 changes: 17 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
✨ Thanks for contributing to **semantic-release**! ✨

As a contributor, here are the guidelines we would like you to follow:

- [Code of conduct](#code-of-conduct)
- [How can I contribute?](#how-can-i-contribute)
- [Using the issue tracker](#using-the-issue-tracker)
Expand Down Expand Up @@ -64,24 +65,31 @@ Here is a summary of the steps to follow:

1. [Set up the workspace](#set-up-the-workspace)
2. If you cloned a while ago, get the latest changes from upstream and update dependencies:

```bash
$ git checkout master
$ git pull upstream master
$ rm -rf node_modules
$ npm install
```

3. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix:

```bash
$ git checkout -b <topic-branch-name>
```

4. Make your code changes, following the [Coding rules](#coding-rules)
5. Push your topic branch up to your fork:

```bash
$ git push origin <topic-branch-name>
```

6. [Open a Pull Request](https://help.github.com/articles/creating-a-pull-request/#creating-the-pull-request) with a clear title and description.

**Tips**:

- For ambitious tasks, open a Pull Request as soon as possible with the `[WIP]` prefix in the title, in order to get feedback and help from the community.
- [Allow semantic-release maintainers to make changes to your Pull Request branch](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork). This way, we can rebase it and make some minor changes if necessary. All changes we make will be done in new commit and we'll ask for your approval before merging them.

Expand All @@ -90,6 +98,7 @@ $ git push origin <topic-branch-name>
### Source code

To ensure consistency and quality throughout the source code, all code modifications must have:

- No [linting](#lint) errors
- A [test](#tests) for every possible case introduced by your code change
- **100%** test coverage
Expand All @@ -100,6 +109,7 @@ To ensure consistency and quality throughout the source code, all code modificat
### Documentation

To ensure consistency and quality, all documentation modifications must:

- Refer to brand in [bold](https://help.github.com/articles/basic-writing-and-formatting-syntax/#styling-text) with proper capitalization, i.e. **GitHub**, **semantic-release**, **npm**
- Prefer [tables](https://help.github.com/articles/organizing-information-with-tables) over [lists](https://help.github.com/articles/basic-writing-and-formatting-syntax/#lists) when listing key values, i.e. List of options with their description
- Use [links](https://help.github.com/articles/basic-writing-and-formatting-syntax/#links) when you are referring to:
Expand All @@ -121,6 +131,7 @@ To ensure consistency and quality, all documentation modifications must:
#### Atomic commits

If possible, make [atomic commits](https://en.wikipedia.org/wiki/Atomic_commit), which means:

- a commit should contain exactly one self-contained functional change
- a functional change should be contained in exactly one commit
- a commit should not create an inconsistent state (such as test errors, linting errors, partial fix, feature with documentation etc...)
Expand Down Expand Up @@ -152,7 +163,7 @@ If the commit reverts a previous commit, it should begin with `revert: `, follow
The type must be one of the following:

| Type | Description |
|--------------|-------------------------------------------------------------------------------------------------------------|
| ------------ | ----------------------------------------------------------------------------------------------------------- |
| **build** | Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
| **ci** | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
| **docs** | Documentation only changes |
Expand All @@ -172,10 +183,12 @@ The subject contains succinct description of the change:
- no dot (.) at the end

#### Body

Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

#### Footer

The footer should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit **Closes**.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
Expand Down Expand Up @@ -224,6 +237,7 @@ All the [semantic-release](https://github.com/semantic-release) repositories use
Before pushing your code changes make sure there are no linting errors with `npm run lint`.

**Tips**:

- Most linting errors can be automatically fixed with `npm run lint -- --fix`.
- Install the [XO plugin](https://github.com/sindresorhus/xo#editor-plugins) for your editor to see linting errors directly in your editor and automatically fix them on save.

Expand All @@ -240,6 +254,7 @@ $ npm run test
```

**Tips:** During development you can:

- run only a subset of test files with `ava <glob>`, for example `ava test/mytestfile.test.js`
- run in watch mode with `ava -w` to automatically run a test file when you modify it
- run only the test you are working on by adding [`.only` to the test definition](https://github.com/avajs/ava#running-specific-tests)
Expand All @@ -251,6 +266,7 @@ All the [semantic-release](https://github.com/semantic-release) repositories use
After staging your changes with `git add`, run `npm run cm` to start the interactive commit message CLI.

### Merging Upstream

Make sure you have an upstream remote added `git remote add upstream https://github.com/semantic-release/semantic-release.git`

1. `git checkout -b merge-upstream`
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
<img alt="npm beta version" src="https://img.shields.io/npm/v/semantic-release-plus/beta.svg">
</a>
</p>
<p align="center">
<a href="#contributors-">
<img alt="Github All Contributors" src="https://img.shields.io/github/all-contributors/semantic-release-plus/semantic-release">
</a>
</p>

<p align="center">
<a href="#contributors-">
Expand Down
Loading

0 comments on commit 20b0c44

Please sign in to comment.