Skip to content

Commit

Permalink
Deploying to gh-pages from @ 1c1657e 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-JG3 committed Mar 22, 2024
1 parent f584dac commit fed6b5d
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ example configuration:
repos:
- repo: https://github.com/stfc/pre-commit-hooks
rev: v0.3.5
rev: v0.3.7
hooks:
- id: check-mypy-import-errors
- id: check-pylint-import-errors
Expand Down
15 changes: 15 additions & 0 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ <h2 id="C">C</h2>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="hooks/check_mypy_imports.html#hooks.check_mypy_import_errors.CheckMypyImportErrors">CheckMypyImportErrors (class in hooks.check_mypy_import_errors)</a>
</li>
<li><a href="hooks/check_pylint_imports.html#hooks.check_pylint_import_errors.CheckPylintImportErrors">CheckPylintImportErrors (class in hooks.check_pylint_import_errors)</a>
</li>
</ul></td>
</tr></table>
Expand All @@ -141,6 +143,13 @@ <h2 id="H">H</h2>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
hooks.check_pylint_import_errors

<ul>
<li><a href="hooks/check_pylint_imports.html#module-hooks.check_pylint_import_errors">module</a>
</li>
</ul></li>
<li>
hooks.utils.hook

<ul>
Expand Down Expand Up @@ -172,6 +181,8 @@ <h2 id="M">M</h2>

<ul>
<li><a href="hooks/check_mypy_imports.html#hooks.check_mypy_import_errors.main">(in module hooks.check_mypy_import_errors)</a>
</li>
<li><a href="hooks/check_pylint_imports.html#hooks.check_pylint_import_errors.main">(in module hooks.check_pylint_import_errors)</a>
</li>
</ul></li>
<li>
Expand All @@ -181,6 +192,8 @@ <h2 id="M">M</h2>
<li><a href="hooks/check_missing_requirements.html#module-hooks.check_missing_requirements">hooks.check_missing_requirements</a>
</li>
<li><a href="hooks/check_mypy_imports.html#module-hooks.check_mypy_import_errors">hooks.check_mypy_import_errors</a>
</li>
<li><a href="hooks/check_pylint_imports.html#module-hooks.check_pylint_import_errors">hooks.check_pylint_import_errors</a>
</li>
<li><a href="utils/hook.html#module-hooks.utils.hook">hooks.utils.hook</a>
</li>
Expand All @@ -205,6 +218,8 @@ <h2 id="R">R</h2>

<ul>
<li><a href="hooks/check_mypy_imports.html#hooks.check_mypy_import_errors.CheckMypyImportErrors.run">(hooks.check_mypy_import_errors.CheckMypyImportErrors method)</a>
</li>
<li><a href="hooks/check_pylint_imports.html#hooks.check_pylint_import_errors.CheckPylintImportErrors.run">(hooks.check_pylint_import_errors.CheckPylintImportErrors method)</a>
</li>
<li><a href="utils/hook.html#hooks.utils.hook.Hook.run">(hooks.utils.hook.Hook method)</a>
</li>
Expand Down
39 changes: 37 additions & 2 deletions hooks/check_pylint_imports.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,43 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<section id="check-pylint-import-errors">
<h1>Check Pylint Import Errors<a class="headerlink" href="#check-pylint-import-errors" title="Permalink to this headline"></a></h1>
<section id="module-hooks.check_pylint_import_errors">
<span id="check-pylint-import-errors"></span><h1>Check Pylint Import Errors<a class="headerlink" href="#module-hooks.check_pylint_import_errors" title="Permalink to this headline"></a></h1>
<p>Check and prevent pylint import errors.</p>
<dl class="py class">
<dt class="sig sig-object py" id="hooks.check_pylint_import_errors.CheckPylintImportErrors">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">hooks.check_pylint_import_errors.</span></span><span class="sig-name descname"><span class="pre">CheckPylintImportErrors</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argv</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Sequence</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#hooks.check_pylint_import_errors.CheckPylintImportErrors" title="Permalink to this definition"></a></dt>
<dd><p>Hook to check whether pylint will raise import errors using the current
project configuration, and fix the config file if necessary.</p>
<p>This is configured to only run when changes to your <cite>requirements.txt</cite> or
<cite>pyproject.toml</cite> file are staged.</p>
<dl class="py method">
<dt class="sig sig-object py" id="hooks.check_pylint_import_errors.CheckPylintImportErrors.run">
<span class="sig-name descname"><span class="pre">run</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">int</span></span></span><a class="headerlink" href="#hooks.check_pylint_import_errors.CheckPylintImportErrors.run" title="Permalink to this definition"></a></dt>
<dd><p>Fixes pylint parameters to prevent the CI pipeline giving import errors
during linting jobs, as not all packages provide pylint support. This
function should be run from within the top level repo directory.</p>
<p>The function applies pylint to this repo, and greps the resultant output
for any import error (E0401) messages. The function will then append
the bad package/module names to the relevant config section to silence
the error in future.</p>
<p>This is a known bug with pylint and in this case, silencing the errors
is the only fix to prevent CI job failure.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>Exception</strong> – if pylint fails to run</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="hooks.check_pylint_import_errors.main">
<span class="sig-prename descclassname"><span class="pre">hooks.check_pylint_import_errors.</span></span><span class="sig-name descname"><span class="pre">main</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#hooks.check_pylint_import_errors.main" title="Permalink to this definition"></a></dt>
<dd><p>Hook entry point</p>
</dd></dl>

</section>


Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h1>Pre-commit hooks<a class="headerlink" href="#pre-commit-hooks" title="Permal
<div class="code-block-caption"><span class="caption-text">.pre-commit-config.yaml</span><a class="headerlink" href="#id1" title="Permalink to this code"></a></div>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">repos</span><span class="p">:</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">repo</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">https://github.com/stfc/pre-commit-hooks</span>
<span class="w"> </span><span class="nt">rev</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">v0.3.5</span>
<span class="w"> </span><span class="nt">rev</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">v0.3.7</span>
<span class="w"> </span><span class="nt">hooks</span><span class="p">:</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">check-mypy-import-errors</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">id</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">check-pylint-import-errors</span>
Expand Down
Binary file modified objects.inv
Binary file not shown.
5 changes: 5 additions & 0 deletions py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ <h1>Python Module Index</h1>
<td>&#160;&#160;&#160;
<a href="hooks/check_mypy_imports.html#module-hooks.check_mypy_import_errors"><code class="xref">hooks.check_mypy_import_errors</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="hooks/check_pylint_imports.html#module-hooks.check_pylint_import_errors"><code class="xref">hooks.check_pylint_import_errors</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fed6b5d

Please sign in to comment.