<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CONTRIBUTING.md - fork/mons @ misc-fixes</title>
<meta name="description" content="CONTRIBUTING.md in fork/mons at misc-fixes.">
<meta property="og:title" content="CONTRIBUTING.md - fork/mons @ misc-fixes">
<meta property="og:description" content="CONTRIBUTING.md in fork/mons at misc-fixes.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="misc-fixes" data-tip="150b6a97c90e113b240e635b6861c2824effedcb">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/mons</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/mons</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">coloursofnoise</span><span class="commit-message" data-commit="f10060e79448c55b46cbe26874d126c87c743986">Add contributing guide</span><span class="snapshot-sha sha" data-commit="f10060e79448c55b46cbe26874d126c87c743986">f10060e</span><time datetime="2022-10-11T15:18:49-07:00" title="2022-10-11 15:18:49 -0700">2022-10-11</time></p>
<header class="topbar"><details class="switcher"><summary>misc-fixes</summary><div class="menu"><strong>branches</strong><a href="/fork/mons/ref/fixes/">fixes</a><a href="/fork/mons/ref/main/">main</a><a class="current" href="/fork/mons/ref/misc-fixes/">misc-fixes</a><a class="all" href="/fork/mons/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/mons/">mons</a> / <span class="cur">CONTRIBUTING.md</span></nav>
<span class="view-stats"><span>3.0 KiB</span><span>70 lines</span></span><span class="actions"><a class="raw" href="/fork/mons/raw/f7ecccd4c28cd12ebe42d56bc807057abdbc71ba/CONTRIBUTING.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h1>CONTRIBUTING</h1>
<h2>Asking for help</h2>
<p>If you are looking for help with setting up or using <code>mons</code>, or you have other questions about how the program works and how you can contribute, please use the <code>#modding_help</code> or <code>#modding_dev</code> channels in the Celeste Community Discord: https://discord.gg/celeste</p>
<h2>Before contributing</h2>
<ul>
<li>Check the <a href="https://github.com/coloursofnoise/mons/issues">existing issues</a> to see if your request has already been made.
<ul>
<li>If so, add a comment to describe how you plan to resolve it and request to have the issue assigned to you.</li>
</ul>
</li>
<li>If an issue does not already exist, create one describing your request and how you plan on implementing it.</li>
</ul>
<h2>First time setup</h2>
<ul>
<li>Clone the GitHub repository locally</li>
</ul>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>git</a-pr> clone https://github.com/coloursofnoise/mons.git
<a-o>$</a-o><a-f> </a-f><a-pr>cd</a-pr> mons</pre>
<ul>
<li>Create a virtualenv</li>
</ul>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>python3</a-pr> <a-co>-m</a-co> venv env
<a-o>$</a-o> <a-f>.</a-f> env/bin/activate</pre>
<ul>
<li>Upgrade <code>pip</code> and <code>setuptools</code></li>
</ul>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>python</a-pr> <a-co>-m</a-co> pip install <a-co>--upgrade</a-co> pip setuptools</pre>
<ul>
<li>Install development dependencies, then install <code>mons</code> in editable mode</li>
</ul>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>pip</a-pr> install <a-co>-r</a-co> requirements-dev.txt
<a-o>$</a-o><a-f> </a-f><a-pr>pip</a-pr> install <a-co>-e</a-co> .</pre>
<ul>
<li>Install the <a href="https://pre-commit.com">pre-commit</a> hooks</li>
</ul>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>pre</a-pr><a-f>-commit</a-f> install</pre>
<h2>Writing code</h2>
<p>When making changes to the project, follow best practices for code and version control wherever possible:</p>
<ul>
<li>Commit frequently, with clear commit messages.</li>
<li>Use <a href="https://black.readthedocs.io">Black</a> to format your code. This and other tools will run automatically if you install <a href="https://pre-commit.com">pre-commit</a> using the instructions above.</li>
<li>Add tests to verify your code. Added tests should fail without your changes.</li>
<li>Add or update docstrings and other relevant documentation.</li>
<li>When creating your pull request, provide a short explanation for your changes and link to the issue being addressed: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue</li>
</ul>
<h2>Running tests</h2>
<h3><code>pytest</code></h3>
<p>Run tests for the current environment with <code>pytest</code></p>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>pytest</a-pr></pre>
<p>To run end-to-end tests using a local Celeste install, run <code>pytest</code> and provide the path for the Celeste install</p>
<p>:warning: When tests fail they can break the install they are run on. <strong>Do not use a Celeste install you care about.</strong></p>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>pytest</a-pr> <a-co>--mons-test-install={/path/to/Celeste/install}</a-co></pre>
<h3><code>tox</code></h3>
<p>The full suite of tests can be run with <code>tox</code>. This will also be run by the CI server when a pull request is submitted</p>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>tox</a-pr></pre>
<p>End-to-end tests can also be run with <code>tox</code></p>
<pre class="language-bash"><a-o>$</a-o><a-f> </a-f><a-pr>tox</a-pr> <a-co>--</a-co> <a-co>--mons-test-install={/path/to/Celeste/install}</a-co></pre>
<h1>MAINTAINERS</h1>
<h2>Releasing a new version</h2>
<ul>
<li>Tag a commit with the format <code>v{version number}</code> where {version number} follows the <a href="https://semver.org/">semver</a> specification.</li>
<li>The CI server will run tests, then build and upload the new version to <a href="https://pypi.org/project/mons/">PyPI</a>.</li>
<li>(Optional) Create a <a href="https://github.com/coloursofnoise/mons/releases">GitHub release</a> for the new tag once CI has completed successfully.</li>
</ul>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>#</a-p> <a-tt>CONTRIBUTING</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text"><a-p>##</a-p> <a-tt>Asking for help</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text">If you are looking for help with setting up or using `mons`, or you have other questions about how the program works and how you can contribute, please use the `#modding_help` or `#modding_dev` channels in the Celeste Community Discord: https://discord.gg/celeste</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"><a-p>##</a-p> <a-tt>Before contributing</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text"><a-p>- </a-p>Check the [existing issues](https://github.com/coloursofnoise/mons/issues) to see if your request has already been made.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"><a-p>  - </a-p>If so, add a comment to describe how you plan to resolve it and request to have the issue assigned to you.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text"><a-p>- </a-p>If an issue does not already exist, create one describing your request and how you plan on implementing it.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"><a-p>## </a-p><a-tt>First time setup</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text"><a-p>- Clone the GitHub repository locally</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"><a-p>```</a-p><a-tl>console</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text"><a-p>$ git clone https://github.com/coloursofnoise/mons.git</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text"><a-p>$ cd mons</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"><a-p>- Create a virtualenv</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text"><a-p>```</a-p><a-tl>console</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"><a-p>$ python3 -m venv env</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text"><a-p>$ . env/bin/activate</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text"><a-p>- Upgrade `pip` and `setuptools`</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text"><a-p>```</a-p><a-tl>console</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text"><a-p>$ python -m pip install --upgrade pip setuptools</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"><a-p>- Install development dependencies, then install `mons` in editable mode</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text"><a-p>```</a-p><a-tl>console</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text"><a-p>$ pip install -r requirements-dev.txt</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text"><a-p>$ pip install -e .</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L31" href="#L31">31</a><span class="code-text"><a-p>- Install the [pre-commit](https://pre-commit.com) hooks</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L32" href="#L32">32</a><span class="code-text"><a-p>```</a-p><a-tl>console</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L33" href="#L33">33</a><span class="code-text"><a-p>$ pre-commit install</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L34" href="#L34">34</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L35" href="#L35">35</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L36" href="#L36">36</a><span class="code-text"><a-p>## </a-p><a-tt>Writing code</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L37" href="#L37">37</a><span class="code-text"><a-p>When making changes to the project, follow best practices for code and version control wherever possible:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L38" href="#L38">38</a><span class="code-text"><a-p>- Commit frequently, with clear commit messages.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L39" href="#L39">39</a><span class="code-text"><a-p>- Use [Black](https://black.readthedocs.io) to format your code. This and other tools will run automatically if you install [pre-commit](https://pre-commit.com) using the instructions above.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L40" href="#L40">40</a><span class="code-text"><a-p>- Add tests to verify your code. Added tests should fail without your changes.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L41" href="#L41">41</a><span class="code-text"><a-p>- Add or update docstrings and other relevant documentation.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L42" href="#L42">42</a><span class="code-text"><a-p>- When creating your pull request, provide a short explanation for your changes and link to the issue being addressed: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L43" href="#L43">43</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L44" href="#L44">44</a><span class="code-text"><a-p>## </a-p><a-tt>Running tests</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L45" href="#L45">45</a><span class="code-text"><a-p>### </a-p><a-tt>`pytest`</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L46" href="#L46">46</a><span class="code-text"><a-p>Run tests for the current environment with `pytest`</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L47" href="#L47">47</a><span class="code-text"><a-p>```</a-p><a-tl>console</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L48" href="#L48">48</a><span class="code-text"><a-p>$ pytest</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L49" href="#L49">49</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L50" href="#L50">50</a><span class="code-text"><a-p>To run end-to-end tests using a local Celeste install, run `pytest` and provide the path for the Celeste install</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L51" href="#L51">51</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L52" href="#L52">52</a><span class="code-text"><a-p>:warning: When tests fail they can break the install they are run on. **Do not use a Celeste install you care about.**</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L53" href="#L53">53</a><span class="code-text"><a-p>```</a-p><a-tl>console</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L54" href="#L54">54</a><span class="code-text"><a-p>$ pytest --mons-test-install={/path/to/Celeste/install}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L55" href="#L55">55</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L56" href="#L56">56</a><span class="code-text"><a-p>### </a-p><a-tt>`tox`</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L57" href="#L57">57</a><span class="code-text"><a-p>The full suite of tests can be run with `tox`. This will also be run by the CI server when a pull request is submitted</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L58" href="#L58">58</a><span class="code-text"><a-p>```</a-p><a-tl>console</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L59" href="#L59">59</a><span class="code-text"><a-p>$ tox</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L60" href="#L60">60</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L61" href="#L61">61</a><span class="code-text"><a-p>End-to-end tests can also be run with `tox`</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L62" href="#L62">62</a><span class="code-text"><a-p>```</a-p><a-tl>console</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L63" href="#L63">63</a><span class="code-text"><a-p>$ tox -- --mons-test-install={/path/to/Celeste/install}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L64" href="#L64">64</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L65" href="#L65">65</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L66" href="#L66">66</a><span class="code-text"><a-p># </a-p><a-tt>MAINTAINERS</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L67" href="#L67">67</a><span class="code-text"><a-p>## </a-p><a-tt>Releasing a new version</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L68" href="#L68">68</a><span class="code-text"><a-p>- Tag a commit with the format `v{version number}` where {version number} follows the [semver](https://semver.org/) specification.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L69" href="#L69">69</a><span class="code-text"><a-p>- The CI server will run tests, then build and upload the new version to [PyPI](https://pypi.org/project/mons/).</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L70" href="#L70">70</a><span class="code-text"><a-p>- </a-p>(Optional) Create a [GitHub release](https://github.com/coloursofnoise/mons/releases) for the new tag once CI has completed successfully.</span></span></pre></div></div>
</main>
</body>
</html>
