Repository: decaffeinate/decaffeinate
Pull request #2473 (2022-06-18 21:05:32)

fix: update references to `master` branch to `main`

github-actions[bot]: :tada: This PR is included in version 8.0.2 :tada:

The release is available on:
- [npm package (@latest dist-tag)](https://www.npmjs.com/package/decaffeinate/v/8.0.2)
- [GitHub release](https://github.com/decaffeinate/decaffeinate/releases/tag/v8.0.2)

Your **[semantic-release](https://github.com/semantic-release/semantic-release)** bot :package::rocket:

Patch:
diff --git a/README.md b/README.md
index c73be033..dd90a14d 100644
--- a/README.md
+++ b/README.md
@@ -191,6 +191,6 @@ For more usage details, see the output of `decaffeinate --help`.
 [crash-issue]: https://github.com/decaffeinate/decaffeinate/issues/new?template=crash.md
 [wrong-issue]: https://github.com/decaffeinate/decaffeinate/issues/new?template=wrong.md
 [feature-issue]: https://github.com/decaffeinate/decaffeinate/issues/new?template=feature.md
-[conversion-guide]: https://github.com/decaffeinate/decaffeinate/blob/master/docs/conversion-guide.md
-[suggestions]: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
-[correctness-issues]: https://github.com/decaffeinate/decaffeinate/blob/master/docs/correctness-issues.md
+[conversion-guide]: https://github.com/decaffeinate/decaffeinate/blob/main/docs/conversion-guide.md
+[suggestions]: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
+[correctness-issues]: https://github.com/decaffeinate/decaffeinate/blob/main/docs/correctness-issues.md
diff --git a/docs/contribution-guide.md b/docs/contribution-guide.md
index a0344da7..5e736fd0 100644
--- a/docs/contribution-guide.md
+++ b/docs/contribution-guide.md
@@ -188,7 +188,7 @@ export default class BoolPatcher extends NodePatcher {
 Now we've got a patcher that rewrites boolean aliases to `true` and `false`! You
 can [the real `BoolPatcher` here][BoolPatcher].
 
-[BoolPatcher]: https://github.com/decaffeinate/decaffeinate/blob/master/src/stages/main/patchers/BoolPatcher.js
+[BoolPatcher]: https://github.com/decaffeinate/decaffeinate/blob/main/src/stages/main/patchers/BoolPatcher.js
 
 In
 addition to `overwrite`, there's `insert` and `remove` which patchers can use to
@@ -338,7 +338,7 @@ the `right` patcher knows to patch using `patchAsExpression` instead of
 `patchAsStatement`. In reality, `PlusOp` and several other binary operators are
 all handled by [`BinaryOpPatcher`][BinaryOpPatcher].
 
-[BinaryOpPatcher]: https://github.com/decaffeinate/decaffeinate/blob/master/src/stages/main/patchers/BinaryOpPatcher.js
+[BinaryOpPatcher]: https://github.com/decaffeinate/decaffeinate/blob/main/src/stages/main/patchers/BinaryOpPatcher.js
 
 Finally, we can omit `patchAsStatement` in this case because all it does is
 delegate to `patchAsExpression`, which is the default behavior.
@@ -395,7 +395,7 @@ actually edits `a().b ||= c` to become:
 (base = a()).b = base.b || c
 ```
 
-[locaop]: https://github.com/decaffeinate/decaffeinate/blob/master/src/stages/main/patchers/LogicalOpCompoundAssignOpPatcher.js
+[locaop]: https://github.com/decaffeinate/decaffeinate/blob/main/src/stages/main/patchers/LogicalOpCompoundAssignOpPatcher.js
 
 How does this work? This is accomplished by the `patchRepeatable` method on
 patchers. It is responsible for editing its node to store the side-effecty parts
@@ -407,7 +407,7 @@ to repeat the source as-is. The `patchAsRepeatableExpression` method can be
 overridden to provide a custom behavior for making the expression repeatable.
 See [`MemberAccessOpPatcher`][maop] for an example.
 
-[maop]: https://github.com/decaffeinate/decaffeinate/blob/master/src/stages/main/patchers/MemberAccessOpPatcher.js
+[maop]: https://github.com/decaffeinate/decaffeinate/blob/main/src/stages/main/patchers/MemberAccessOpPatcher.js
 
 Temporary variables may also be introduced as loop counters or similar. To claim
 a temporary variable, just use the patchers' `claimFreeBinding` method,
@@ -435,10 +435,10 @@ appropriate in a post-processing step.
 If you have found a bug or have a feature you'd like to add, it is probably
 worth creating an issue to document the bug or discuss the feature before doing
 significant work. Once you've decided on an approach, get the code and check
-that the tests all pass as shown above, create a branch based on `master` with
+that the tests all pass as shown above, create a branch based on `main` with
 a descriptive name such as `fix-binary-operator-statements` or `add-support-for-soaked-member-access`.
 Make changes to fix your bug or add your feature, ensuring that you write tests
-covering the changes. The tests you add or change *should fail* on `master`.
+covering the changes. The tests you add or change *should fail* on `main`.
 
 ### Commit messages
 
@@ -454,7 +454,11 @@ We use [semantic-release](https://github.com/semantic-release/semantic-release)
 * use lowercase on the first line of the commit message without a period
 * if backward-incompatible changes are in a commit, add `BREAKING CHANGE:` to the footer of the commit with a description
 
-Why do we use this commit message style? To automate releases. Whenever a build passes on `master`, semantic-release will look at the commits since the last release and adjust the version appropriately. Commits with `fix:` bump the patch version, `feat:` bumps the minor version, and `BREAKING CHANGE:` bumps the major version (only one of the three will be bumped per release).
+Why do we use this commit message style? To automate releases. Whenever a build
+passes on `main`, semantic-release will look at the commits since the last
+release and adjust the version appropriately. Commits with `fix:` bump the patch
+version, `feat:` bumps the minor version, and `BREAKING CHANGE:` bumps the major
+version (only one of the three will be bumped per release).
 
 Once you're satisfied with your changes, create a pull request on your own fork.
 Please provide a description of *why* you're issuing the pull request, and
diff --git a/script/update-website.ts b/script/update-website.ts
index 298aefc4..17f7228f 100644
--- a/script/update-website.ts
+++ b/script/update-website.ts
@@ -72,8 +72,8 @@ async function updateWebsite(): Promise<void> {
   const decaffeinateRegistry = decaffeinatePackage['publishConfig']['registry'];
 
   console.log('Setting up website repo…');
-  await run('git', ['fetch', '-f', 'website', 'master:website-master']);
-  await run('git', ['reset', '--hard', 'website-master']);
+  await run('git', ['fetch', '-f', 'website', 'main:website-main']);
+  await run('git', ['reset', '--hard', 'website-main']);
 
   const websitePackage = await pkg();
   const currentVersion = websitePackage['devDependencies']['decaffeinate'] as string;
@@ -94,7 +94,7 @@ async function updateWebsite(): Promise<void> {
       if (commit) {
         console.log('Pushing changes to website repo…');
         await run('git', ['commit', '-av', '-m', `chore: update to decaffeinate ${latestVersion}`]);
-        await run('git', ['push', 'website', 'HEAD:master']);
+        await run('git', ['push', 'website', 'HEAD:main']);
       } else {
         console.log('Not committing because --no-commit was given:');
         console.log((await run('git', ['diff'])).stdout);
diff --git a/src/suggestions.ts b/src/suggestions.ts
index a5c1b771..cec5d3db 100644
--- a/src/suggestions.ts
+++ b/src/suggestions.ts
@@ -91,7 +91,7 @@ export function prependSuggestionComment(code: string, suggestions: Array<Sugges
     '/*',
     ' * decaffeinate suggestions:',
     ...suggestions.map(({ suggestionCode, message }) => ` * ${suggestionCode}: ${message}`),
-    ' * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md',
+    ' * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md',
     ' */',
   ];
 


Test patch:
diff --git a/test/cli_test.ts b/test/cli_test.ts
index 6f723033..fcd78cf7 100644
--- a/test/cli_test.ts
+++ b/test/cli_test.ts
@@ -296,7 +296,7 @@ describe('decaffeinate CLI', () => {
       /*
        * decaffeinate suggestions:
        * DS102: Remove unnecessary code created because of implicit returns
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       const f = (x = 1) => 2;
     `
@@ -370,7 +370,7 @@ describe('decaffeinate CLI', () => {
       /*
        * decaffeinate suggestions:
        * DS002: Fix invalid constructor
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       class A extends B {
         constructor() {
@@ -396,7 +396,7 @@ describe('decaffeinate CLI', () => {
       /*
        * decaffeinate suggestions:
        * DS002: Fix invalid constructor
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       class A extends B {
         constructor() {
@@ -448,7 +448,7 @@ describe('decaffeinate CLI', () => {
       /*
        * decaffeinate suggestions:
        * DS207: Consider shorter variations of null checks
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       typeof a !== 'undefined' && a !== null;
     `
diff --git a/test/suggestions_test.ts b/test/suggestions_test.ts
index b127efaf..6a77b003 100644
--- a/test/suggestions_test.ts
+++ b/test/suggestions_test.ts
@@ -13,7 +13,7 @@ describe('suggestions', () => {
        * decaffeinate suggestions:
        * DS002: Fix invalid constructor
        * DS102: Remove unnecessary code created because of implicit returns
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       class A extends B {
         constructor(...args) {
@@ -42,7 +42,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS102: Remove unnecessary code created because of implicit returns
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       class A extends B {
         constructor(...args) {
@@ -93,7 +93,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS002: Fix invalid constructor
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       class A extends B {
         constructor(c) {
@@ -126,7 +126,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS101: Remove unnecessary use of Array.from
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       for (let a of Array.from(b)) {
         c;
@@ -168,7 +168,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS101: Remove unnecessary use of Array.from
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       Array.from(b).includes(a);
     `,
@@ -190,7 +190,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS102: Remove unnecessary code created because of implicit returns
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       (() => f());
     `,
@@ -249,7 +249,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       __guard__(a(), x => x.b);
       function __guard__(value, transform) {
@@ -290,7 +290,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS207: Consider shorter variations of null checks
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       if (typeof a !== 'undefined' && a !== null) {
         a.b;
@@ -313,7 +313,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS104: Avoid inline assignments
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       let name;
       accounts[name = getAccountId()] = Math.floor(accounts[name] / splitFactor);
@@ -351,7 +351,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS201: Simplify complex destructure assignments
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       const array = d.a, b = array[0], c = array[array.length - 1];
     `,
@@ -389,7 +389,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS202: Simplify dynamic range loops
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       for (let a = b, end = c, asc = b <= end; asc ? a <= end : a >= end; asc ? a++ : a--) {
         d;
@@ -432,7 +432,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS203: Remove \`|| {}\` from converted for-own loops
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       for (let a of Object.keys(b || {})) {
         c;
@@ -457,7 +457,7 @@ describe('suggestions', () => {
        * DS101: Remove unnecessary use of Array.from
        * DS104: Avoid inline assignments
        * DS204: Change includes calls to have a more natural evaluation order
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       let needle;
       (needle = a(), Array.from(b()).includes(needle));
@@ -479,7 +479,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS101: Remove unnecessary use of Array.from
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       Array.from(b).includes(a);
     `,
@@ -503,7 +503,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS205: Consider reworking code to avoid use of IIFEs
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       const x = (() => { try {
         return a;
@@ -532,7 +532,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS102: Remove unnecessary code created because of implicit returns
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       (function() {
         if (a) {
@@ -560,7 +560,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS206: Consider reworking classes to avoid initClass
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       class A {
         static initClass() {
@@ -606,7 +606,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS207: Consider shorter variations of null checks
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       const a = 1;
       const x = a != null ? a : b;
@@ -629,7 +629,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS207: Consider shorter variations of null checks
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       const a = 1;
       const b = (a != null);
@@ -651,7 +651,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS208: Avoid top-level this
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       this;
     `,
@@ -673,7 +673,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS208: Avoid top-level this
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       () => {
         return this;
@@ -735,7 +735,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS209: Avoid top-level return
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       if (foo) {
         return;
@@ -760,7 +760,7 @@ describe('suggestions', () => {
       /*
        * decaffeinate suggestions:
        * DS207: Consider shorter variations of null checks
-       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
+       * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
        */
       if (typeof a !== 'undefined' && a !== null) {
         a.b;