Package: pyright-polite
pyright-politepyright-politeis an intelligent cross-platform wrapper forpyrightthat makes
it less noisy.Force pyright to be more respectful with your attention :rotating_light:What does it do?Withpyright-polite:$pyright-politeFound 7 source files0 errors, 0 warnings, 0 informationsWithout:$pyrightWARNING: there is a new pyright version available (v1.1.300 -> v1.1.301).Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to `latest`No configuration file found.pyproject.toml file found at /projects/pyright_polite.Loading pyproject.toml file at /projects/pyright_polite/pyproject.tomlAssuming Python version 3.11Assuming Python platform LinuxAuto-excluding **/node_modulesAuto-excluding **/__pycache__Auto-excluding **/.*stubPath /projects/pyright_polite/typings is not a valid directory.Searching for source filesFound 7 source filespyright 1.1.3000 errors, 0 warnings, 0 informationsCompleted in 1.006secNow pyright is just as polite as your other tools:$hatchrunlintcmd [1] | - ruff check .cmd [2] | - black --quiet --check --diff .cmd [3] | - pyright-politeFound 8 source files0 errors, 0 warnings, 0 informationscmd [4] | - ssort --check --diff .8 files would be left unchangedError messages are still shown (eg, if your pyright config file is invalid).InstallationYou needpyrightinstalled (ie, available somewhere in yourPATH).See pyright's installation instructionshere. Usually people install
either thepyright npmor thepyright PyPIpackage.$npminstallpyright# alternatively: pip install pyright$pipinstallpyright-politeLinux, macOS and Windows are all supported.Usagepyright-politetakes the same arguments as pyright.$pyright-polite-hUsage: pyright-polite [options] files...Options:--createstub <IMPORT>              Create type stub file(s) for import--dependencies                     Emit import dependency information-h,--help                          Show this help message--ignoreexternal                   Ignore external imports for --verifytypes--lib                              Use library code to infer types when stubs are missing--level <LEVEL>                    Minimum diagnostic level (error or warning)--outputjson                       Output results in JSON format-p,--project <FILE OR DIRECTORY>   Use the configuration file at this location--pythonplatform <PLATFORM>        Analyze for a specific platform (Darwin, Linux, Windows)--pythonversion <VERSION>          Analyze for a specific version (3.3, 3.4, etc.)--skipunannotated                  Skip analysis of functions with no type annotations--stats                            Print detailed performance stats-t,--typeshed-path <DIRECTORY>     Use typeshed type stubs at this location-v,--venv-path <DIRECTORY>         Directory that contains virtual environments--verbose                          Emit verbose diagnostics--verifytypes <PACKAGE>            Verify type completeness of a py.typed package--version                          Print Pyright version--warnings                         Use exit code of 1 if warnings are reported-w,--watch                         Continue to run and watch for changesNote: pyright-polite does not filter output from `--dependencies` or `--stats`.How does it work?pyright-politeis hilariously over-engineered, but robust.It aims to display everything in exactly the same format and colorisation as pyright
(minus the useless messages), and takes advantage of pyright's--outputjsonoption
when possible. It launchespyrightas a subprocess and reads from both stderr and
stdout usingasynciotasks, which means that--watchis also supported.For insight into what messages get hidden, see theprint_filteredmethod.Isn't this a bit overkill?Yes :rofl:It was primarily a fun weekend project to learnasyncio.Why is pyright so noisy?If you're wondering whypyrighthas to remind us thattypings is not a valid directory(among other useless messages) on literally every single launch, seepyright #4594for what the developers have to say:The current information output by the cli is there for a reason.Licensepyright-politeis distributed under the terms of theMITlicense.