Skip to content

Commit

Permalink
Deploy preview for PR 346 🛫
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDrike committed Aug 9, 2024
1 parent f8ab8e0 commit 63f4717
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
38 changes: 34 additions & 4 deletions pr-preview/pr-346/contributing/guides/precommit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,15 @@
</span>
</a>

</li>

<li class="md-nav__item">
<a href="#hooks-that-modify-files" class="md-nav__link">
<span class="md-ellipsis">
Hooks that modify files
</span>
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -1125,6 +1134,15 @@
</span>
</a>

</li>

<li class="md-nav__item">
<a href="#hooks-that-modify-files" class="md-nav__link">
<span class="md-ellipsis">
Hooks that modify files
</span>
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -1178,12 +1196,12 @@


<h1 id="pre-commit">Pre-commit<a class="headerlink" href="#pre-commit" title="Permanent link">&para;</a></h1>
<div class="admonition abstract">
<p class="admonition-title">Abstract</p>
<details class="abstract" open="open">
<summary>Abstract</summary>
<p>This guide explains what is pre-commit and how to set it up as a git hook that will run automatically before your
commits. It also describes how to run pre-commit manually from the CLI, how to skip some or all of the individual
checks it performs and where it's configuration file is.</p>
</div>
</details>
<p>Now that you've seen the linters, formatters, type-checkers and other tools that we use in the project, you might be
wondering whether you're really expected to run all of those commands manually, after each change. And of course, no,
you're not, that would be really annoying, and you'd probably also often just forget to do that.</p>
Expand All @@ -1206,6 +1224,15 @@ <h2 id="installing-pre-commit">Installing pre-commit<a class="headerlink" href="
<p>Pre-commit itself will be installed via poetry, which means you will need to have an activated poetry environment
whenever you make a new commit, otherwise, the pre-commit git hook will fail with command not found.</p>
</div>
<h2 id="hooks-that-modify-files">Hooks that modify files<a class="headerlink" href="#hooks-that-modify-files" title="Permanent link">&para;</a></h2>
<p>Sometimes, hooks can end up modifying your files, for example the ruff format hook may do so if your file wasn't
already formatted by ruff. When this happens, the hook itself will fail, which will make git abort the commit. At this
point, you will be left with the original changes still staged, but some files may have been modified, which means
you'll want to <code>git add</code> those again, staging these automatic modifications and then make the commit again.</p>
<p>Note that in case you were only committing a <a href="../great-commits/#partial-adds">partial change</a>, which means you still
had some parts of the file unstaged, pre-commit will not modify the files for you. Instead, the hook will just fail,
leaving the rest up to you. You should now run the formatter yourself and perform another partial add, updating the
staged changes to be compliant.</p>
<h2 id="running-manually">Running manually<a class="headerlink" href="#running-manually" title="Permanent link">&para;</a></h2>
<p>Even though in most cases, it will be more than enough to have pre-commit run automatically as a git hook,
sometimes, you may want to run it manually without making a commit.</p>
Expand Down Expand Up @@ -1242,8 +1269,11 @@ <h2 id="skipping-pre-commit">Skipping pre-commit<a class="headerlink" href="#ski
<p>The names of the individual hooks are their ids, you can find those in the <a href="#configuration">configuration file</a> for
pre-commit.</p>
</div>
<p>However this kind of verification skipping should be used sparingly. We value a clean history which consistently follows
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This kind of verification skipping should be used sparingly. We value a clean history which consistently follows
our linting guidelines, and making commits with linting issues only leads to more commits, fixing those issues later.</p>
</div>
<h2 id="configuration">Configuration<a class="headerlink" href="#configuration" title="Permanent link">&para;</a></h2>
<p>You can find pre-commit's configuration the <code>.pre-commit-config.yaml</code> file, where we define which tools should be ran
and how. Currently, pre-commit runs ruff linter, ruff formatter, slotscheck and basedpyright, but also a checker for
Expand Down
14 changes: 7 additions & 7 deletions pr-preview/pr-346/installation/changelog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,13 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#exec-1--version-v050-185-g82af2-2024-08-09" class="md-nav__link">
<a href="#exec-1--version-v050-185-g34111-2024-08-09" class="md-nav__link">
<span class="md-ellipsis">
Version v0.5.0-185-g82af2 (2024-08-09)
Version v0.5.0-185-g34111 (2024-08-09)
</span>
</a>

<nav class="md-nav" aria-label="Version v0.5.0-185-g82af2 (2024-08-09)">
<nav class="md-nav" aria-label="Version v0.5.0-185-g34111 (2024-08-09)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -1312,13 +1312,13 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#exec-1--version-v050-185-g82af2-2024-08-09" class="md-nav__link">
<a href="#exec-1--version-v050-185-g34111-2024-08-09" class="md-nav__link">
<span class="md-ellipsis">
Version v0.5.0-185-g82af2 (2024-08-09)
Version v0.5.0-185-g34111 (2024-08-09)
</span>
</a>

<nav class="md-nav" aria-label="Version v0.5.0-185-g82af2 (2024-08-09)">
<nav class="md-nav" aria-label="Version v0.5.0-185-g34111 (2024-08-09)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -1581,7 +1581,7 @@ <h1 id="changelog">Changelog<a class="headerlink" href="#changelog" title="Perma
</div>
<p><details class="example" open="open">
<summary>Unreleased Changes</summary>
<h2 id="exec-1--version-v050-185-g82af2-2024-08-09">Version v0.5.0-185-g82af2 (2024-08-09)<a class="headerlink" href="#exec-1--version-v050-185-g82af2-2024-08-09" title="Permanent link">&para;</a></h2>
<h2 id="exec-1--version-v050-185-g34111-2024-08-09">Version v0.5.0-185-g34111 (2024-08-09)<a class="headerlink" href="#exec-1--version-v050-185-g34111-2024-08-09" title="Permanent link">&para;</a></h2>
<h3 id="exec-1--features">Features<a class="headerlink" href="#exec-1--features" title="Permanent link">&para;</a></h3>
<ul>
<li><a href="https://github.com/py-mine/mcproto/issues/209">#209</a>: Added <code>InvalidPacketContentError</code> exception, raised when deserializing of a specific packet fails. This error inherits from <code>IOError</code>, making it backwards compatible with the original implementation.</li>
Expand Down
2 changes: 1 addition & 1 deletion pr-preview/pr-346/search/search_index.json

Large diffs are not rendered by default.

0 comments on commit 63f4717

Please sign in to comment.