Skip to content

Commit

Permalink
Deployed ce472cd with MkDocs version: 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Aug 21, 2024
1 parent 8f4375d commit cf60f04
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
22 changes: 19 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
<li class="md-nav__item">
<a href="#cargo-rust-package-manager" class="md-nav__link">
<span class="md-ellipsis">
cargo (rust package manager)
cargo (Rust package manager)
</span>
</a>

Expand Down Expand Up @@ -425,6 +425,15 @@
</span>
</a>

</li>

<li class="md-nav__item">
<a href="#join-us" class="md-nav__link">
<span class="md-ellipsis">
Join us!
</span>
</a>

</li>

</ul>
Expand Down Expand Up @@ -651,14 +660,14 @@ <h2 id="installation">Installation<a class="headerlink" href="#installation" tit
<h3 id="pip">pip<a class="headerlink" href="#pip" title="Permanent link">#</a></h3>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>pip<span class="w"> </span>install<span class="w"> </span>pylyzer
</code></pre></div>
<h3 id="cargo-rust-package-manager">cargo (rust package manager)<a class="headerlink" href="#cargo-rust-package-manager" title="Permanent link">#</a></h3>
<h3 id="cargo-rust-package-manager">cargo (Rust package manager)<a class="headerlink" href="#cargo-rust-package-manager" title="Permanent link">#</a></h3>
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>cargo<span class="w"> </span>install<span class="w"> </span>pylyzer<span class="w"> </span>--locked
</code></pre></div>
<h3 id="build-from-source">build from source<a class="headerlink" href="#build-from-source" title="Permanent link">#</a></h3>
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/mtshiba/pylyzer.git
<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a>cargo<span class="w"> </span>install<span class="w"> </span>--path<span class="w"> </span>.<span class="w"> </span>--locked
</code></pre></div>
<p>Make sure that <code>cargo/rustc</code> is up-to-date, as pylyzer may be written with the latest language features.</p>
<p>Make sure that <code>cargo</code>/<code>rustc</code> is up-to-date, as pylyzer may be written with the latest (stable) language features.</p>
<h3 id="github-releases"><a href="https://github.com/mtshiba/pylyzer/releases/latest">GitHub Releases</a><a class="headerlink" href="#github-releases" title="Permanent link">#</a></h3>
<h2 id="what-is-the-advantage-over-pylint-pyright-pytype-etc">What is the advantage over pylint, pyright, pytype, etc.?<a class="headerlink" href="#what-is-the-advantage-over-pylint-pyright-pytype-etc" title="Permanent link">#</a></h2>
<ul>
Expand Down Expand Up @@ -759,6 +768,13 @@ <h2 id="todos">TODOs<a class="headerlink" href="#todos" title="Permanent link">#
<li class="task-list-item"><label class="task-list-control"><input type="checkbox" disabled/><span class="task-list-indicator"></span></label> <code>pyi</code> (stub) files support</li>
<li class="task-list-item"><label class="task-list-control"><input type="checkbox" disabled/><span class="task-list-indicator"></span></label> glob pattern file check</li>
</ul>
<h2 id="join-us">Join us!<a class="headerlink" href="#join-us" title="Permanent link">#</a></h2>
<p>We are looking for contributors to help us improve pylyzer. If you are interested in contributing and have any questions, please feel free to contact us.</p>
<ul>
<li><a href="https://discord.gg/kQBuaSUS46">Discord (Erg language)</a></li>
<li><a href="https://discord.com/channels/1006946336433774742/1056815981168697354">#pylyzer</a></li>
<li><a href="https://github.com/mtshiba/pylyzer/discussions">GitHub discussions</a></li>
</ul>
<hr />
<p><span id="1" style="font-size:x-small"><sup>1</sup> The performance test was conducted on MacBook (Early 2016) with 1.1 GHz Intel Core m3 processor and 8 GB 1867 MHz LPDDR3 memory.<a href="#f1"></a></span></p>

Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"pylyzer \u26a1","text":"<p><code>pylyzer</code> is a static code analyzer / language server for Python, written in Rust.</p>"},{"location":"#installation","title":"Installation","text":""},{"location":"#pip","title":"pip","text":"<pre><code>pip install pylyzer\n</code></pre>"},{"location":"#cargo-rust-package-manager","title":"cargo (rust package manager)","text":"<pre><code>cargo install pylyzer --locked\n</code></pre>"},{"location":"#build-from-source","title":"build from source","text":"<pre><code>git clone https://github.com/mtshiba/pylyzer.git\ncargo install --path . --locked\n</code></pre> <p>Make sure that <code>cargo/rustc</code> is up-to-date, as pylyzer may be written with the latest language features.</p>"},{"location":"#github-releases","title":"GitHub Releases","text":""},{"location":"#what-is-the-advantage-over-pylint-pyright-pytype-etc","title":"What is the advantage over pylint, pyright, pytype, etc.?","text":"<ul> <li>Performance \ud83c\udf1f</li> </ul> <p>On average, pylyzer can inspect Python scripts more than 100 times faster than pytype and pyright <sup>1</sup>. This is largely due to the fact that pylyzer is implemented in Rust.</p> <p></p> <ul> <li>Reports readability \ud83d\udcd6</li> </ul> <p>While pytype/pyright's error reports are illegible, pylyzer shows where the error occurred and provides clear error messages.</p>"},{"location":"#pyright","title":"pyright","text":""},{"location":"#pylyzer_1","title":"pylyzer \ud83d\ude03","text":"<ul> <li>Rich LSP support \ud83d\udcdd</li> </ul> <p>pylyzer as a language server supports various features, such as completion and renaming (The language server is an adaptation of the Erg Language Server (ELS). For more information on the implemented features, please see here).</p> <p></p> <p></p>"},{"location":"#vscode-extension","title":"VSCode extension","text":"<p>You can install the VSCode extension from the Marketplace or from the command line:</p> <pre><code>code --install-extension pylyzer.pylyzer\n</code></pre>"},{"location":"#what-is-the-difference-from-ruff","title":"What is the difference from Ruff?","text":"<p>Ruff, like pylyzer, is a static code analysis tool for Python written in Rust, but Ruff is a linter and pylyzer is a type checker &amp; language server. pylyzer does not perform linting, and Ruff does not perform type checking.</p>"},{"location":"#how-it-works","title":"How it works","text":"<p>pylyzer uses the type checker of the Erg programming language internally. This language is a transpiled language that targets Python, and has a static type system.</p> <p>pylyzer converts Python ASTs to Erg ASTs and passes them to Erg's type checker. It then displays the results with appropriate modifications.</p>"},{"location":"#limitations","title":"Limitations","text":"<ul> <li> <p>pylyzer's type inspector only assumes (potentially) statically typed code, so you cannot check any code uses reflections, such as <code>exec</code>, <code>setattr</code>, etc.</p> </li> <li> <p>pylyzer (= Erg's type system) has its own type declarations for the Python standard APIs. Typing of all APIs is not complete and may result in an error that such an API does not exist.</p> </li> <li> <p>Since pylyzer's type checking is conservative, you may encounter many (possibly false positive) errors. We are working on fixing this, but if you are concerned about editor errors, please turn off the diagnostics feature.</p> </li> </ul>"},{"location":"#todos","title":"TODOs","text":"<ul> <li> type checking</li> <li> variable</li> <li> operator</li> <li> function/method</li> <li> class</li> <li> type inference</li> <li> variable</li> <li> operator</li> <li> function/method</li> <li> class</li> <li> builtin modules analysis</li> <li> local scripts analysis</li> <li> local packages analysis</li> <li> LSP features</li> <li> diagnostics</li> <li> completion</li> <li> rename</li> <li> hover</li> <li> goto definition</li> <li> signature help</li> <li> find references</li> <li> document symbol</li> <li> call hierarchy</li> <li> collection types</li> <li> <code>list</code></li> <li> <code>dict</code></li> <li> <code>tuple</code></li> <li> <code>typing</code></li> <li> <code>Union</code></li> <li> <code>Optional</code></li> <li> <code>Literal</code></li> <li> <code>Callable</code></li> <li> <code>TypedDict</code></li> <li> <code>TypeVar</code></li> <li> <code>Generic</code></li> <li> <code>Protocol</code></li> <li> <code>Final</code></li> <li> <code>Annotated</code></li> <li> <code>TypeAlias</code></li> <li> <code>TypeGuard</code></li> <li> type parameter syntax</li> <li> type narrowing</li> <li> others</li> <li><code>collections.abc</code></li> <li> <code>Iterable</code></li> <li> <code>Iterator</code></li> <li> <code>Mapping</code></li> <li> <code>Sequence</code></li> <li> others</li> <li> type assertion (<code>typing.cast</code>)</li> <li> type narrowing (<code>is</code>, <code>isinstance</code>)</li> <li> <code>pyi</code> (stub) files support</li> <li> glob pattern file check</li> </ul> <p><sup>1</sup> The performance test was conducted on MacBook (Early 2016) with 1.1 GHz Intel Core m3 processor and 8 GB 1867 MHz LPDDR3 memory.\u21a9</p>"},{"location":"editor/","title":"Editor integrations","text":""},{"location":"editor/#vscode","title":"VSCode","text":"<ul> <li>Install the extension.</li> </ul>"},{"location":"editor/#neovim","title":"Neovim","text":"<ul> <li>Setup mason.</li> <li>Type <code>:MasonInstall pylyzer</code> in Neovim.</li> </ul> <p>If you use LunarVim, no setup is required. Just install pylyzer and you are good to go.</p>"},{"location":"errors/errors/","title":"Pylyzer-specific errors","text":""},{"location":"errors/errors/#e0001-reassignment-of-a-function-referenced-by-other-functions","title":"E0001: Reassignment of a function referenced by other functions","text":"<pre><code>def g(): return f()\n\ndef f(): return 1\ndef f(): return \"a\" # E0001: Reassignment of a function referenced by other functions\n\nprint(g())\n</code></pre>"},{"location":"errors/errors/#e0002-__init__-doesnt-have-a-first-parameter-named-self","title":"E0002: <code>__init__</code> doesn't have a first parameter named <code>self</code>","text":"<pre><code>class C:\n def __init__(a): pass # E0002\n</code></pre>"},{"location":"errors/errors/#e0003-__init__-as-a-member-variable","title":"E0003: <code>__init__</code> as a member variable","text":"<pre><code>class C:\n __init__ = 1 # E0003\n</code></pre>"},{"location":"errors/warns/","title":"Pylyzer-specific warnings","text":""},{"location":"errors/warns/#w0188-used-value","title":"W0188: Used value","text":"<pre><code>def f(x): return x\n\nf(1) # W0188: UnusedWarning: the evaluation result of the expression (: {1, }) is not used\n</code></pre>"},{"location":"options/options/","title":"command line options","text":""},{"location":"options/options/#-server","title":"--server","text":"<p>Launch as a language server.</p>"},{"location":"options/options/#-dump-decl","title":"--dump-decl","text":"<p>Dump a type declarations file (d.er) after type checking.</p> <pre><code>$ pylyzer --dump-decl test.py\nStart checking: test.py\nAll checks OK: test.py\n\n$ ls\ntest.py test.d.er\n</code></pre>"},{"location":"options/options/#-c-code","title":"-c/--code","text":"<p>Check code from the command line.</p> <pre><code>$ pylyzer -c \"print('hello world')\"\nStart checking: string\nAll checks OK: string\n</code></pre>"},{"location":"options/pyproject/","title":"<code>pyproject.toml</code> options","text":""},{"location":"options/pyproject/#toolpylyzerpythonpath","title":"<code>tool.pylyzer.python.path</code>","text":"<p>Path to the Python interpreter to use. If not set, the default Python interpreter will be used.</p> <pre><code>[tool.pylyzer.python]\npath = \"path/to/python\"\n</code></pre>"}]}
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"pylyzer \u26a1","text":"<p><code>pylyzer</code> is a static code analyzer / language server for Python, written in Rust.</p>"},{"location":"#installation","title":"Installation","text":""},{"location":"#pip","title":"pip","text":"<pre><code>pip install pylyzer\n</code></pre>"},{"location":"#cargo-rust-package-manager","title":"cargo (Rust package manager)","text":"<pre><code>cargo install pylyzer --locked\n</code></pre>"},{"location":"#build-from-source","title":"build from source","text":"<pre><code>git clone https://github.com/mtshiba/pylyzer.git\ncargo install --path . --locked\n</code></pre> <p>Make sure that <code>cargo</code>/<code>rustc</code> is up-to-date, as pylyzer may be written with the latest (stable) language features.</p>"},{"location":"#github-releases","title":"GitHub Releases","text":""},{"location":"#what-is-the-advantage-over-pylint-pyright-pytype-etc","title":"What is the advantage over pylint, pyright, pytype, etc.?","text":"<ul> <li>Performance \ud83c\udf1f</li> </ul> <p>On average, pylyzer can inspect Python scripts more than 100 times faster than pytype and pyright <sup>1</sup>. This is largely due to the fact that pylyzer is implemented in Rust.</p> <p></p> <ul> <li>Reports readability \ud83d\udcd6</li> </ul> <p>While pytype/pyright's error reports are illegible, pylyzer shows where the error occurred and provides clear error messages.</p>"},{"location":"#pyright","title":"pyright","text":""},{"location":"#pylyzer_1","title":"pylyzer \ud83d\ude03","text":"<ul> <li>Rich LSP support \ud83d\udcdd</li> </ul> <p>pylyzer as a language server supports various features, such as completion and renaming (The language server is an adaptation of the Erg Language Server (ELS). For more information on the implemented features, please see here).</p> <p></p> <p></p>"},{"location":"#vscode-extension","title":"VSCode extension","text":"<p>You can install the VSCode extension from the Marketplace or from the command line:</p> <pre><code>code --install-extension pylyzer.pylyzer\n</code></pre>"},{"location":"#what-is-the-difference-from-ruff","title":"What is the difference from Ruff?","text":"<p>Ruff, like pylyzer, is a static code analysis tool for Python written in Rust, but Ruff is a linter and pylyzer is a type checker &amp; language server. pylyzer does not perform linting, and Ruff does not perform type checking.</p>"},{"location":"#how-it-works","title":"How it works","text":"<p>pylyzer uses the type checker of the Erg programming language internally. This language is a transpiled language that targets Python, and has a static type system.</p> <p>pylyzer converts Python ASTs to Erg ASTs and passes them to Erg's type checker. It then displays the results with appropriate modifications.</p>"},{"location":"#limitations","title":"Limitations","text":"<ul> <li> <p>pylyzer's type inspector only assumes (potentially) statically typed code, so you cannot check any code uses reflections, such as <code>exec</code>, <code>setattr</code>, etc.</p> </li> <li> <p>pylyzer (= Erg's type system) has its own type declarations for the Python standard APIs. Typing of all APIs is not complete and may result in an error that such an API does not exist.</p> </li> <li> <p>Since pylyzer's type checking is conservative, you may encounter many (possibly false positive) errors. We are working on fixing this, but if you are concerned about editor errors, please turn off the diagnostics feature.</p> </li> </ul>"},{"location":"#todos","title":"TODOs","text":"<ul> <li> type checking</li> <li> variable</li> <li> operator</li> <li> function/method</li> <li> class</li> <li> type inference</li> <li> variable</li> <li> operator</li> <li> function/method</li> <li> class</li> <li> builtin modules analysis</li> <li> local scripts analysis</li> <li> local packages analysis</li> <li> LSP features</li> <li> diagnostics</li> <li> completion</li> <li> rename</li> <li> hover</li> <li> goto definition</li> <li> signature help</li> <li> find references</li> <li> document symbol</li> <li> call hierarchy</li> <li> collection types</li> <li> <code>list</code></li> <li> <code>dict</code></li> <li> <code>tuple</code></li> <li> <code>typing</code></li> <li> <code>Union</code></li> <li> <code>Optional</code></li> <li> <code>Literal</code></li> <li> <code>Callable</code></li> <li> <code>TypedDict</code></li> <li> <code>TypeVar</code></li> <li> <code>Generic</code></li> <li> <code>Protocol</code></li> <li> <code>Final</code></li> <li> <code>Annotated</code></li> <li> <code>TypeAlias</code></li> <li> <code>TypeGuard</code></li> <li> type parameter syntax</li> <li> type narrowing</li> <li> others</li> <li><code>collections.abc</code></li> <li> <code>Iterable</code></li> <li> <code>Iterator</code></li> <li> <code>Mapping</code></li> <li> <code>Sequence</code></li> <li> others</li> <li> type assertion (<code>typing.cast</code>)</li> <li> type narrowing (<code>is</code>, <code>isinstance</code>)</li> <li> <code>pyi</code> (stub) files support</li> <li> glob pattern file check</li> </ul>"},{"location":"#join-us","title":"Join us!","text":"<p>We are looking for contributors to help us improve pylyzer. If you are interested in contributing and have any questions, please feel free to contact us.</p> <ul> <li>Discord (Erg language)</li> <li>#pylyzer</li> <li>GitHub discussions</li> </ul> <p><sup>1</sup> The performance test was conducted on MacBook (Early 2016) with 1.1 GHz Intel Core m3 processor and 8 GB 1867 MHz LPDDR3 memory.\u21a9</p>"},{"location":"editor/","title":"Editor integrations","text":""},{"location":"editor/#vscode","title":"VSCode","text":"<ul> <li>Install the extension.</li> </ul>"},{"location":"editor/#neovim","title":"Neovim","text":"<ul> <li>Setup mason.</li> <li>Type <code>:MasonInstall pylyzer</code> in Neovim.</li> </ul> <p>If you use LunarVim, no setup is required. Just install pylyzer and you are good to go.</p>"},{"location":"errors/errors/","title":"Pylyzer-specific errors","text":""},{"location":"errors/errors/#e0001-reassignment-of-a-function-referenced-by-other-functions","title":"E0001: Reassignment of a function referenced by other functions","text":"<pre><code>def g(): return f()\n\ndef f(): return 1\ndef f(): return \"a\" # E0001: Reassignment of a function referenced by other functions\n\nprint(g())\n</code></pre>"},{"location":"errors/errors/#e0002-__init__-doesnt-have-a-first-parameter-named-self","title":"E0002: <code>__init__</code> doesn't have a first parameter named <code>self</code>","text":"<pre><code>class C:\n def __init__(a): pass # E0002\n</code></pre>"},{"location":"errors/errors/#e0003-__init__-as-a-member-variable","title":"E0003: <code>__init__</code> as a member variable","text":"<pre><code>class C:\n __init__ = 1 # E0003\n</code></pre>"},{"location":"errors/warns/","title":"Pylyzer-specific warnings","text":""},{"location":"errors/warns/#w0188-used-value","title":"W0188: Used value","text":"<pre><code>def f(x): return x\n\nf(1) # W0188: UnusedWarning: the evaluation result of the expression (: {1, }) is not used\n</code></pre>"},{"location":"options/options/","title":"command line options","text":""},{"location":"options/options/#-server","title":"--server","text":"<p>Launch as a language server.</p>"},{"location":"options/options/#-dump-decl","title":"--dump-decl","text":"<p>Dump a type declarations file (d.er) after type checking.</p> <pre><code>$ pylyzer --dump-decl test.py\nStart checking: test.py\nAll checks OK: test.py\n\n$ ls\ntest.py test.d.er\n</code></pre>"},{"location":"options/options/#-c-code","title":"-c/--code","text":"<p>Check code from the command line.</p> <pre><code>$ pylyzer -c \"print('hello world')\"\nStart checking: string\nAll checks OK: string\n</code></pre>"},{"location":"options/pyproject/","title":"<code>pyproject.toml</code> options","text":""},{"location":"options/pyproject/#toolpylyzerpythonpath","title":"<code>tool.pylyzer.python.path</code>","text":"<p>Path to the Python interpreter to use. If not set, the default Python interpreter will be used.</p> <pre><code>[tool.pylyzer.python]\npath = \"path/to/python\"\n</code></pre>"}]}
Loading

0 comments on commit cf60f04

Please sign in to comment.