Repository: graphprotocol/graph-tooling
Pull request #1866 (2024-12-19 00:54:21)

Remove skip-git deprecation warning

changeset-bot[bot]: ###  🦋  Changeset detected

Latest commit: b097214754735f5ce076206533767f6bc2816a25

**The changes in this PR will be included in the next version bump.**

<details><summary>This PR includes changesets to release 1 package</summary>

  | Name                     | Type  |
| ------------------------ | ----- |
| @graphprotocol/graph-cli | Patch |

</details>

Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/graphprotocol/graph-tooling/new/yaro/skip-git-flag?filename=.changeset/purple-pumas-attend.md&value=---%0A%22%40graphprotocol%2Fgraph-cli%22%3A%20patch%0A---%0A%0ARemove%20skip-git%20deprecation%20warning%0A)


cloudflare-workers-and-pages[bot]: ## Deploying graph-tooling with &nbsp;<a href="https://pages.dev"><img alt="Cloudflare Pages" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png" width="16"></a> &nbsp;Cloudflare Pages

<table><tr><td><strong>Latest commit:</strong> </td><td>
<code>5456573</code>
</td></tr>
<tr><td><strong>Status:</strong></td><td>⚡️&nbsp; Build in progress...</td></tr>
</table>

[View logs](https://dash.cloudflare.com/?to=/:account/pages/view/graph-tooling/443bebf7-e650-4620-bb2d-fb268b5d5283)


Patch:
diff --git a/.changeset/gorgeous-flies-teach.md b/.changeset/gorgeous-flies-teach.md
new file mode 100644
index 00000000..7bdf5d28
--- /dev/null
+++ b/.changeset/gorgeous-flies-teach.md
@@ -0,0 +1,5 @@
+---
+'@graphprotocol/graph-cli': patch
+---
+
+show skip-git deprecation warning only when used
diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts
index 0e9ddfec..f1f45bc6 100644
--- a/packages/cli/src/commands/init.ts
+++ b/packages/cli/src/commands/init.ts
@@ -81,10 +81,6 @@ export default class InitCommand extends Command {
     'skip-git': Flags.boolean({
       summary: 'Skip initializing a Git repository.',
       default: false,
-      deprecated: {
-        message:
-          'In next major version, this flag will be removed. By default we will stop initializing a Git repository.',
-      },
     }),
     'start-block': Flags.string({
       helpGroup: 'Scaffold from contract',
@@ -142,6 +138,12 @@ export default class InitCommand extends Command {
 
     initDebugger('Flags: %O', flags);
 
+    if (skipGit) {
+      this.warn(
+        'The --skip-git flag will be removed in the next major version. By default we will stop initializing a Git repository.',
+      );
+    }
+
     const { node } = chooseNodeUrl({
       node: nodeFlag,
     });


Test patch:
diff --git a/packages/cli/tests/cli/__snapshots__/init.test.ts.snap b/packages/cli/tests/cli/__snapshots__/init.test.ts.snap
index 3791039d..17fbfbbc 100644
--- a/packages/cli/tests/cli/__snapshots__/init.test.ts.snap
+++ b/packages/cli/tests/cli/__snapshots__/init.test.ts.snap
@@ -1,8 +1,8 @@
 // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
 
 exports[`Init > Ethereum > From contract 1`] = `
-" ›   Warning: In next major version, this flag will be removed. By default we 
- ›   will stop initializing a Git repository.
+" ›   Warning: The --skip-git flag will be removed in the next major version. By
+ ›    default we will stop initializing a Git repository.
 - Create subgraph scaffold
   Generate subgraph
 - Create subgraph scaffold
@@ -37,8 +37,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
 `;
 
 exports[`Init > Ethereum > From contract with abi 1`] = `
-" ›   Warning: In next major version, this flag will be removed. By default we 
- ›   will stop initializing a Git repository.
+" ›   Warning: The --skip-git flag will be removed in the next major version. By
+ ›    default we will stop initializing a Git repository.
 - Create subgraph scaffold
   Generate subgraph
 - Create subgraph scaffold
@@ -73,8 +73,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
 `;
 
 exports[`Init > Ethereum > From contract with abi and structs 1`] = `
-" ›   Warning: In next major version, this flag will be removed. By default we 
- ›   will stop initializing a Git repository.
+" ›   Warning: The --skip-git flag will be removed in the next major version. By
+ ›    default we will stop initializing a Git repository.
 - Create subgraph scaffold
   Generate subgraph
 - Create subgraph scaffold
@@ -109,8 +109,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
 `;
 
 exports[`Init > Ethereum > From contract with index events and abi with ID in events 1`] = `
-" ›   Warning: In next major version, this flag will be removed. By default we 
- ›   will stop initializing a Git repository.
+" ›   Warning: The --skip-git flag will be removed in the next major version. By
+ ›    default we will stop initializing a Git repository.
 - Create subgraph scaffold
   Generate subgraph
 - Create subgraph scaffold
@@ -145,8 +145,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
 `;
 
 exports[`Init > Ethereum > From contract with list items in abi 1`] = `
-" ›   Warning: In next major version, this flag will be removed. By default we 
- ›   will stop initializing a Git repository.
+" ›   Warning: The --skip-git flag will be removed in the next major version. By
+ ›    default we will stop initializing a Git repository.
 - Create subgraph scaffold
   Generate subgraph
 - Create subgraph scaffold
@@ -181,8 +181,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
 `;
 
 exports[`Init > Ethereum > From contract with overloaded elements 1`] = `
-" ›   Warning: In next major version, this flag will be removed. By default we 
- ›   will stop initializing a Git repository.
+" ›   Warning: The --skip-git flag will be removed in the next major version. By
+ ›    default we will stop initializing a Git repository.
 - Create subgraph scaffold
   Generate subgraph
 - Create subgraph scaffold
@@ -217,8 +217,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
 `;
 
 exports[`Init > Ethereum > From example 1`] = `
-" ›   Warning: In next major version, this flag will be removed. By default we 
- ›   will stop initializing a Git repository.
+" ›   Warning: The --skip-git flag will be removed in the next major version. By
+ ›    default we will stop initializing a Git repository.
 - Cloning example subgraph
 ✔ Cloning example subgraph
 - Initialize networks config
@@ -251,8 +251,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
 `;
 
 exports[`Init > NEAR > From contract 1`] = `
-" ›   Warning: In next major version, this flag will be removed. By default we 
- ›   will stop initializing a Git repository.
+" ›   Warning: The --skip-git flag will be removed in the next major version. By
+ ›    default we will stop initializing a Git repository.
 - Create subgraph scaffold
   Generate subgraph
 - Create subgraph scaffold