-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1246: Configure Pyright
- Loading branch information
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"pythonVersion": "3.8", | ||
"include": ["augur/"], | ||
|
||
|
||
// These are rules that are enabled by default and currently have violations. | ||
|
||
// TODO: go through these exceptions and determine if they should be kept or | ||
// removed and violations addressed. | ||
|
||
// TODO: consider aligning this with the same file in nextstrain/cli: | ||
// <https://github.com/nextstrain/cli/blob/-/pyrightconfig.json> | ||
"reportArgumentType": false, | ||
"reportAttributeAccessIssue": false, | ||
"reportCallIssue": false, | ||
"reportGeneralTypeIssues": false, | ||
"reportIncompatibleMethodOverride": false, | ||
"reportMissingImports": false, | ||
"reportMissingModuleSource": false, | ||
"reportOperatorIssue": false, | ||
"reportOptionalIterable": false, | ||
"reportOptionalMemberAccess": false, | ||
"reportOptionalOperand": false, | ||
"reportOptionalSubscript": false, | ||
"reportPossiblyUnboundVariable": false, | ||
"reportPrivateImportUsage": false, | ||
"reportSelfClsParameterName": false, | ||
"reportUndefinedVariable": false, | ||
"reportUnusedExpression": false, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pytest | ||
from pathlib import Path | ||
from shutil import which | ||
from subprocess import run | ||
|
||
topdir = Path(__file__).resolve().parent.parent | ||
|
||
pyright = which("pyright") | ||
npx = which("npx") | ||
|
||
if pyright: | ||
pyright = [pyright] | ||
elif npx: | ||
pyright = [npx, "pyright"] | ||
else: | ||
pyright = None | ||
|
||
@pytest.mark.skipif(not pyright, reason = "pyright is not available") | ||
def test_pyright(): | ||
# Check the exit status ourselves for nicer test output on failure | ||
result = run(pyright, cwd = topdir) | ||
assert result.returncode == 0, "pyright exited with errors" |