<titledata-rh="true">Contributing | Task</title><metadata-rh="true"name="viewport"content="width=device-width,initial-scale=1"><metadata-rh="true"name="twitter:card"content="summary_large_image"><metadata-rh="true"property="og:url"content="https://taskfile.dev/contributing/"><metadata-rh="true"name="docusaurus_locale"content="en"><metadata-rh="true"name="docsearch:language"content="en"><metadata-rh="true"name="og:image"content="https://taskfile.dev/img/og-image.png"><metadata-rh="true"name="docusaurus_version"content="current"><metadata-rh="true"name="docusaurus_tag"content="docs-default-current"><metadata-rh="true"name="docsearch:version"content="current"><metadata-rh="true"name="docsearch:docusaurus_tag"content="docs-default-current"><metadata-rh="true"property="og:title"content="Contributing | Task"><metadata-rh="true"name="description"content="Contributions to Task are very welcome, but we ask that you read this document"><metadata-rh="true"property="og:description"content="Contributions to Task are very welcome, but we ask that you read this document"><linkdata-rh="true"rel="icon"href="/img/favicon.ico"><linkdata-rh="true"rel="canonical"href="https://taskfile.dev/contributing/"><linkdata-rh="true"rel="alternate"href="https://taskfile.dev/contributing/"hreflang="en-US"><linkdata-rh="true"rel="alternate"href="https://taskfile.dev/fr-FR/contributing/"hreflang="fr-FR"><linkdata-rh="true"rel="alternate"href="https://taskfile.dev/pt-BR/contributing/"hreflang="pt-BR"><linkdata-rh="true"rel="alternate"href="https://taskfile.dev/ru-RU/contributing/"hreflang="ru-RU"><linkdata-rh="true"rel="alternate"href="https://taskfile.dev/zh-Hans/contributing/"hreflang="zh-Hans"><linkdata-rh="true"rel="alternate"href="https://taskfile.dev/contributing/"hreflang="x-default"><linkdata-rh="true"rel="preconnect"href="https://7IZIJ13AI7-dsn.algolia.net"crossorigin="anonymous"><linkrel="preconnect"href="https://www.google-analytics.com">
Studio Code</a>.</p></div></div><h2class="anchor anchorWithStickyNavbar_LWe7"id="before-you-start">Before you start<ahref="#before-you-start"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h2><ul><li><strong>Check existing work</strong> - Is there an existing PR? Are there issues discussing
consider opening an issue first so that API changes can be discussed before
you invest your time into a PR.</li></ul><h2class="anchor anchorWithStickyNavbar_LWe7"id="1-setup">1. Setup<ahref="#1-setup"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h2><ul><li><strong>Go</strong> - Task is written in <ahref="https://go.dev"target="_blank"rel="noopener noreferrer">Go</a>. We always support the latest two major
Go versions, so make sure your version is recent enough.</li><li><strong>Node.js</strong> - <ahref="https://nodejs.org/en/"target="_blank"rel="noopener noreferrer">Node.js</a> is used to host Task's documentation server
and is required if you want to run this server locally. It is also required if
you want to contribute to the Visual Studio Code extension.</li><li><strong>Yarn</strong> - <ahref="https://yarnpkg.com/"target="_blank"rel="noopener noreferrer">Yarn</a> is the Node.js package manager used by Task.</li></ul><h2class="anchor anchorWithStickyNavbar_LWe7"id="2-making-changes">2. Making changes<ahref="#2-making-changes"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h2><ul><li><strong>Code style</strong> - Try to maintain the existing code style where possible. Go
code should be formatted by <ahref="https://github.com/mvdan/gofumpt"target="_blank"rel="noopener noreferrer"><code>gofumpt</code></a> and linted using
<ahref="https://golangci-lint.run"target="_blank"rel="noopener noreferrer"><code>golangci-lint</code></a>. Any Markdown or TypeScript files should be
formatted and linted by <ahref="https://prettier.io"target="_blank"rel="noopener noreferrer">Prettier</a>. This style is enforced by our CI
to ensure that we have a consistent style across the project. You can use the
<code>task lint</code> command to lint the code locally and the <code>task lint:fix</code> command
to automatically fix any issues that are found.</li><li><strong>Documentation</strong> - Ensure that you add/update any relevant documentation. See
the <ahref="#updating-documentation">updating documentation</a> section below.</li><li><strong>Tests</strong> - Ensure that you add/update any relevant tests and that all tests
are passing before submitting the PR. See the <ahref="#writing-tests">writing tests</a>
section below.</li></ul><h3class="anchor anchorWithStickyNavbar_LWe7"id="running-your-changes">Running your changes<ahref="#running-your-changes"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h3><p>To run Task with working changes, you can use <code>go run ./cmd/task</code>. To run a
<code>go run ./cmd/task --dir ./testdata/<my_test_dir><task_name></code>.</p><p>To run Task for Visual Studio Code, you can open the project in VSCode and hit
F5 (or whatever you debug keybind is set to). This will open a new VSCode window
with the extension running. Debugging this way is recommended as it will allow
you to set breakpoints and step through the code. Otherwise, you can run
<code>task package</code> which will generate a <code>.vsix</code> file that can be used to manually
install the extension.</p><h3class="anchor anchorWithStickyNavbar_LWe7"id="updating-documentation">Updating documentation<ahref="#updating-documentation"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h3><p>Task uses <ahref="https://docusaurus.io"target="_blank"rel="noopener noreferrer">Docusaurus</a> to host a documentation server. The code for
this is located in the core Task repository. This can be setup and run locally
by using <code>task docs</code> (requires <code>nodejs</code>&<code>yarn</code>). All content is written in
Markdown and is located in the <code>docs/docs</code> directory. All Markdown documents
should have an 80 character line wrap limit (enforced by Prettier).</p><p>When making a change, consider whether a change to the <ahref="/usage/">Usage Guide</a>
<ahref="https://github.com/go-task/task/blob/main/docs/static/schema.json"target="_blank"rel="noopener noreferrer">JSON Schema</a>. The descriptions for fields in the API reference and
the schema should match.</p><h3class="anchor anchorWithStickyNavbar_LWe7"id="writing-tests">Writing tests<ahref="#writing-tests"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h3><p>A lot of Task's tests are held in the <code>task_test.go</code> file in the project root
and this is where you'll most likely want to add new ones too. Most of these
tests also have a subdirectory in the <code>testdata</code> directory where any
Taskfiles/data required to run the tests are stored.</p><p>When making a changes, consider whether new tests are required. These tests
behavior.</p><p>You may also consider adding unit tests for any new functions you have added.
The unit tests should follow the Go convention of being location in a file named
<code>*_test.go</code> in the same package as the code being tested.</p><h2class="anchor anchorWithStickyNavbar_LWe7"id="3-committing-your-code">3. Committing your code<ahref="#3-committing-your-code"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h2><p>Try to write meaningful commit messages and avoid having too many commits on the
be reasonable to split it in a few). Git squash and rebase is your friend!</p><p>If you're not sure how to format your commit message, check out <ahref="https://www.conventionalcommits.org"target="_blank"rel="noopener noreferrer">Conventional
Commits</a>. This style is not enforced, but it is a good way
to make your commit messages more readable and consistent.</p><h2class="anchor anchorWithStickyNavbar_LWe7"id="4-submitting-a-pr">4. Submitting a PR<ahref="#4-submitting-a-pr"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h2><ul><li><strong>Describe your changes</strong> - Ensure that you provide a comprehensive
Please describe how your changes differ to/extend this work.</li><li><strong>Examples</strong> - Add any examples or screenshots that you think are useful to
demonstrate the effect of your changes.</li><li><strong>Draft PRs</strong> - If your changes are incomplete, but you would like to discuss
later while preserving any discussions.</li></ul><h2class="anchor anchorWithStickyNavbar_LWe7"id="faq">FAQ<ahref="#faq"class="hash-link"aria-label="Direct link to heading"title="Direct link to heading"></a></h2><blockquote><p>I want to contribute, where do I start?</p></blockquote><p>Take a look at the list of <ahref="https://github.com/go-task/task/issues"target="_blank"rel="noopener noreferrer">open issues for Task</a> or <ahref="https://github.com/go-task/vscode-task/issues"target="_blank"rel="noopener noreferrer">Task for
Visual Studio Code</a>. We have a <ahref="https://github.com/go-task/task/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22"target="_blank"rel="noopener noreferrer">good first
answer questions or contributing to other <ahref="/community/">community projects</a>.</p><blockquote><p>I'm stuck, where can I get help?</p></blockquote><p>If you have questions, feel free to ask them in the <code>#help</code> forum channel on our