Skip to content

Commit

Permalink
style: prettier (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m authored Oct 7, 2022
1 parent de9e756 commit 745e826
Show file tree
Hide file tree
Showing 40 changed files with 2,719 additions and 10,656 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Documentation: <link to the documentation page listing the environment variables>

Environment variables:

- service detection: <variable name that allow to verify the process runs on this CI env>
- Branch: <variable name that allow to get the branch being built>
- Commit sha: <variable name that allow to get the commit sha that has triggered the build>
Expand All @@ -14,20 +15,24 @@ Environment variables:
- Build number: <variable name that allow to get the build number>

<!-- Fill the following section to report a bug -->

## Bug

<Bug description>

<Steps to reproduce>

Environment:

- CI: <CI service name>
- Build link: <link to the build on which the problem happened (if public)>

<!-- Fill the following section to request the support of a new variable -->

## Support variable <name of the variable>

<Reason to add the new variable>

Documentation:

- <CI name>: <link to the documentation of the variable to support>
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
node-version:
# minimal required version
- '12.20'
- "12.20"
# minimal required version for latest semantic-release
- 14.17
# latest LTS version
Expand Down
20 changes: 10 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ religion, or sexual identity and orientation.
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
- 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
- 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
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities
Expand Down
70 changes: 35 additions & 35 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
const process = require('process');
const git = require('./services/git.js');
const process = require("process");
const git = require("./services/git.js");

const services = {
appveyor: require('./services/appveyor.js'),
azurePipelines: require('./services/azure-pipelines.js'),
bamboo: require('./services/bamboo.js'),
bitbucket: require('./services/bitbucket.js'),
bitrise: require('./services/bitrise.js'),
buddy: require('./services/buddy.js'),
buildkite: require('./services/buildkite.js'),
circleci: require('./services/circleci.js'),
cirrus: require('./services/cirrus.js'),
cloudflarePages: require('./services/cloudflare-pages.js'),
codebuild: require('./services/codebuild.js'),
codefresh: require('./services/codefresh.js'),
codeship: require('./services/codeship.js'),
drone: require('./services/drone.js'),
github: require('./services/github.js'),
gitlab: require('./services/gitlab.js'),
jenkins: require('./services/jenkins.js'),
netlify: require('./services/netlify.js'),
puppet: require('./services/puppet.js'),
sail: require('./services/sail.js'),
scrutinizer: require('./services/scrutinizer.js'),
semaphore: require('./services/semaphore.js'),
shippable: require('./services/shippable.js'),
teamcity: require('./services/teamcity.js'),
travis: require('./services/travis.js'),
vela: require('./services/vela.js'),
vercel: require('./services/vercel.js'),
wercker: require('./services/wercker.js'),
woodpecker: require('./services/woodpecker.js'),
appveyor: require("./services/appveyor.js"),
azurePipelines: require("./services/azure-pipelines.js"),
bamboo: require("./services/bamboo.js"),
bitbucket: require("./services/bitbucket.js"),
bitrise: require("./services/bitrise.js"),
buddy: require("./services/buddy.js"),
buildkite: require("./services/buildkite.js"),
circleci: require("./services/circleci.js"),
cirrus: require("./services/cirrus.js"),
cloudflarePages: require("./services/cloudflare-pages.js"),
codebuild: require("./services/codebuild.js"),
codefresh: require("./services/codefresh.js"),
codeship: require("./services/codeship.js"),
drone: require("./services/drone.js"),
github: require("./services/github.js"),
gitlab: require("./services/gitlab.js"),
jenkins: require("./services/jenkins.js"),
netlify: require("./services/netlify.js"),
puppet: require("./services/puppet.js"),
sail: require("./services/sail.js"),
scrutinizer: require("./services/scrutinizer.js"),
semaphore: require("./services/semaphore.js"),
shippable: require("./services/shippable.js"),
teamcity: require("./services/teamcity.js"),
travis: require("./services/travis.js"),
vela: require("./services/vela.js"),
vercel: require("./services/vercel.js"),
wercker: require("./services/wercker.js"),
woodpecker: require("./services/woodpecker.js"),
};

module.exports = ({env = process.env, cwd = process.cwd()} = {}) => {
module.exports = ({ env = process.env, cwd = process.cwd() } = {}) => {
for (const name of Object.keys(services)) {
if (services[name].detect({env, cwd})) {
return {isCi: true, ...services[name].configuration({env, cwd})};
if (services[name].detect({ env, cwd })) {
return { isCi: true, ...services[name].configuration({ env, cwd }) };
}
}

return {isCi: Boolean(env.CI), ...git.configuration({env, cwd})};
return { isCi: Boolean(env.CI), ...git.configuration({ env, cwd }) };
};
18 changes: 9 additions & 9 deletions lib/git.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
const execa = require('execa');
const execa = require("execa");

function head(options) {
try {
return execa.sync('git', ['rev-parse', 'HEAD'], options).stdout;
return execa.sync("git", ["rev-parse", "HEAD"], options).stdout;
} catch {
return undefined;
}
}

function branch(options) {
try {
const headRef = execa.sync('git', ['rev-parse', '--abbrev-ref', 'HEAD'], options).stdout;
const headRef = execa.sync("git", ["rev-parse", "--abbrev-ref", "HEAD"], options).stdout;

if (headRef === 'HEAD') {
if (headRef === "HEAD") {
const branch = execa
.sync('git', ['show', '-s', '--pretty=%d', 'HEAD'], options)
.stdout.replace(/^\(|\)$/g, '')
.split(', ')
.find((branch) => branch.startsWith('origin/'));
.sync("git", ["show", "-s", "--pretty=%d", "HEAD"], options)
.stdout.replace(/^\(|\)$/g, "")
.split(", ")
.find((branch) => branch.startsWith("origin/"));
return branch ? branch.match(/^origin\/(?<branch>.+)/)[1] : undefined;
}

Expand All @@ -27,4 +27,4 @@ function branch(options) {
}
}

module.exports = {head, branch};
module.exports = { head, branch };
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ function parseBranch(branch) {
return branch ? /^(?:refs\/heads\/)?(?<branch>.+)$/i.exec(branch)[1] : undefined;
}

module.exports = {prNumber, parseBranch};
module.exports = { prNumber, parseBranch };
Loading

0 comments on commit 745e826

Please sign in to comment.