forked from PrairieLearn/PrairieLearn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
88 lines (83 loc) · 3.14 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
[tool.flake8]
filename = [
"./elements/**/*.py",
"./graders/**/*.py",
"./python/*.py",
"./exampleCourse/**/*.py",
"./testCourse/**/*.py"
]
exclude = [
# These files are intentionally not parseable as Python.
"./exampleCourse/questions/demo/autograder/codeUpload/submitted_code_samples/fib_error_binary_file/fib.py",
"./exampleCourse/questions/demo/autograder/codeUpload/submitted_code_samples/fib_error_large_text_file/fib.py",
]
per-file-ignores = [
# Files related to the Python autograder will often intentionally appear
# broken in isolation. We'll allow specific errors in these files to
# account for that.
#
# - F401: module imported but unused
# - F821: undefined name
# - F841: local variable name is assigned to but never used
# - E999: SyntaxError
"exampleCourse/questions/**/tests/setup_code.py: F401, F821",
"exampleCourse/questions/**/tests/initial_code.py: F401, F821, E999",
"exampleCourse/questions/**/tests/leading_code.py: F401, F821, F841",
"exampleCourse/questions/**/tests/trailing_code.py: F821, E999",
"exampleCourse/questions/**/tests/ans.py: F821",
# Questions commonly use "ambiguous variable names" to represent specific
# concepts, e.g. I for an identity matrix. We'll allow these to be used in
# questions.
"exampleCourse/questions/**/*.py: E741",
# The zygote specifically uses imports in strange places to facilitate the
# preloading of commonly-used modules.
"zygote.py: E402, F401"
]
ignore = ["E501"]
# Black compatibility
max-line-length = 88
extend-ignore = ["E203", "W503"]
[tool.black]
extend-exclude = '''
(
^\/tools\/|\/node_modules\/
# The following Python files are intentionally invalid
| ^\/exampleCourse\/questions\/demo\/autograder\/codeUpload\/submitted_code_samples\/fib_error_binary_file\/fib.py
| ^\/exampleCourse\/questions\/demo\/autograder\/codeUpload\/submitted_code_samples\/fib_error_large_text_file\/fib.py
| ^\/exampleCourse\/questions\/demo\/autograder\/python\/leadingTrailing\/tests\/trailing_code.py
| ^\/exampleCourse\/questions\/demo\/autograder\/python\/square\/tests\/initial_code.py
)
'''
[tool.isort]
profile = "black"
skip_glob = ["tools/*", "node_modules/*"]
[tool.pyright]
include = [
"./elements/pl-answer-panel",
"./elements/pl-big-o-input",
"./elements/pl-card",
"./elements/pl-code",
"./elements/pl-dataframe",
"./elements/pl-external-grader-variables",
"./elements/pl-file-preview",
"./elements/pl-file-upload",
"./elements/pl-graph",
"./elements/pl-hidden-hints",
"./elements/pl-hide-in-manual-grading",
"./elements/pl-hide-in-panel",
"./elements/pl-manual-grading-only",
"./elements/pl-python-variable",
"./elements/pl-question-panel",
"./elements/pl-submission-panel",
"./elements/pl-symbolic-input",
"./elements/pl-units-input",
"./elements/pl-variable-output",
"./python/conftest.py",
"./python/colors.py",
"./python/prairielearn.py",
"./python/prairielearn_test.py",
"./python/python_helper_sympy.py",
"./python/python_helper_sympy_test.py"
]
extraPaths = ["./python"]
pythonVersion = "3.9"