-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
ruff.json
3189 lines (3189 loc) · 108 KB
/
ruff.json
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/ruff.json",
"additionalProperties": false,
"definitions": {
"ApiBan": {
"type": "object",
"required": ["msg"],
"properties": {
"msg": {
"description": "The message to display when the API is used.",
"type": "string"
}
},
"additionalProperties": false
},
"ConstantType": {
"type": "string",
"enum": ["bytes", "complex", "float", "int", "str"]
},
"Convention": {
"oneOf": [
{
"description": "Use Google-style docstrings.",
"type": "string",
"enum": ["google"]
},
{
"description": "Use NumPy-style docstrings.",
"type": "string",
"enum": ["numpy"]
},
{
"description": "Use PEP257-style docstrings.",
"type": "string",
"enum": ["pep257"]
}
]
},
"Flake8AnnotationsOptions": {
"type": "object",
"properties": {
"allow-star-arg-any": {
"description": "Whether to suppress `ANN401` for dynamically typed `*args` and `**kwargs` arguments.",
"type": ["boolean", "null"]
},
"ignore-fully-untyped": {
"description": "Whether to suppress `ANN*` rules for any declaration that hasn't been typed at all. This makes it easier to gradually add types to a codebase.",
"type": ["boolean", "null"]
},
"mypy-init-return": {
"description": "Whether to allow the omission of a return type hint for `__init__` if at least one argument is annotated.",
"type": ["boolean", "null"]
},
"suppress-dummy-args": {
"description": "Whether to suppress `ANN000`-level violations for arguments matching the \"dummy\" variable regex (like `_`).",
"type": ["boolean", "null"]
},
"suppress-none-returning": {
"description": "Whether to suppress `ANN200`-level violations for functions that meet either of the following criteria:\n\n- Contain no `return` statement. - Explicit `return` statement(s) all return `None` (explicitly or implicitly).",
"type": ["boolean", "null"]
}
},
"additionalProperties": false
},
"Flake8BanditOptions": {
"type": "object",
"properties": {
"check-typed-exception": {
"description": "Whether to disallow `try`-`except`-`pass` (`S110`) for specific exception types. By default, `try`-`except`-`pass` is only disallowed for `Exception` and `BaseException`.",
"type": ["boolean", "null"]
},
"hardcoded-tmp-directory": {
"description": "A list of directories to consider temporary.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"hardcoded-tmp-directory-extend": {
"description": "A list of directories to consider temporary, in addition to those specified by `hardcoded-tmp-directory`.",
"type": ["array", "null"],
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Flake8BugbearOptions": {
"type": "object",
"properties": {
"extend-immutable-calls": {
"description": "Additional callable functions to consider \"immutable\" when evaluating, e.g., the `function-call-in-default-argument` rule (`B008`) or `function-call-in-dataclass-defaults` rule (`RUF009`).\n\nExpects to receive a list of fully-qualified names (e.g., `fastapi.Query`, rather than `Query`).",
"type": ["array", "null"],
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Flake8BuiltinsOptions": {
"type": "object",
"properties": {
"builtins-ignorelist": {
"description": "Ignore list of builtins.",
"type": ["array", "null"],
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Flake8ComprehensionsOptions": {
"type": "object",
"properties": {
"allow-dict-calls-with-keyword-arguments": {
"description": "Allow `dict` calls that make use of keyword arguments (e.g., `dict(a=1, b=2)`).",
"type": ["boolean", "null"]
}
},
"additionalProperties": false
},
"Flake8CopyrightOptions": {
"type": "object",
"properties": {
"author": {
"description": "Author to enforce within the copyright notice. If provided, the author must be present immediately following the copyright notice.",
"type": ["string", "null"]
},
"min-file-size": {
"description": "A minimum file size (in bytes) required for a copyright notice to be enforced. By default, all files are validated.",
"type": ["integer", "null"],
"format": "uint",
"minimum": 0.0
},
"notice-rgx": {
"description": "The regular expression used to match the copyright notice, compiled with the [`regex`](https://docs.rs/regex/latest/regex/) crate.\n\nDefaults to `(?i)Copyright\\s+(\\(C\\)\\s+)?\\d{4}(-\\d{4})*`, which matches the following: - `Copyright 2023` - `Copyright (C) 2023` - `Copyright 2021-2023` - `Copyright (C) 2021-2023`",
"type": ["string", "null"]
}
},
"additionalProperties": false
},
"Flake8ErrMsgOptions": {
"type": "object",
"properties": {
"max-string-length": {
"description": "Maximum string length for string literals in exception messages.",
"type": ["integer", "null"],
"format": "uint",
"minimum": 0.0
}
},
"additionalProperties": false
},
"Flake8GetTextOptions": {
"type": "object",
"properties": {
"extend-function-names": {
"description": "Additional function names to consider as internationalization calls, in addition to those included in `function-names`.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"function-names": {
"description": "The function names to consider as internationalization calls.",
"type": ["array", "null"],
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Flake8ImplicitStrConcatOptions": {
"type": "object",
"properties": {
"allow-multiline": {
"description": "Whether to allow implicit string concatenations for multiline strings. By default, implicit concatenations of multiline strings are allowed (but continuation lines, delimited with a backslash, are prohibited).\n\nNote that setting `allow-multiline = false` should typically be coupled with disabling `explicit-string-concatenation` (`ISC003`). Otherwise, both explicit and implicit multiline string concatenations will be seen as violations.",
"type": ["boolean", "null"]
}
},
"additionalProperties": false
},
"Flake8ImportConventionsOptions": {
"type": "object",
"properties": {
"aliases": {
"description": "The conventional aliases for imports. These aliases can be extended by the `extend_aliases` option.",
"type": ["object", "null"],
"additionalProperties": {
"type": "string"
}
},
"banned-aliases": {
"description": "A mapping from module to its banned import aliases.",
"type": ["object", "null"],
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"banned-from": {
"description": "A list of modules that should not be imported from using the `from ... import ...` syntax.\n\nFor example, given `banned-from = [\"pandas\"]`, `from pandas import DataFrame` would be disallowed, while `import pandas` would be allowed.",
"type": ["array", "null"],
"items": {
"type": "string"
},
"uniqueItems": true
},
"extend-aliases": {
"description": "A mapping from module to conventional import alias. These aliases will be added to the `aliases` mapping.",
"type": ["object", "null"],
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Flake8PytestStyleOptions": {
"type": "object",
"properties": {
"fixture-parentheses": {
"description": "Boolean flag specifying whether `@pytest.fixture()` without parameters should have parentheses. If the option is set to `true` (the default), `@pytest.fixture()` is valid and `@pytest.fixture` is invalid. If set to `false`, `@pytest.fixture` is valid and `@pytest.fixture()` is invalid.",
"type": ["boolean", "null"]
},
"mark-parentheses": {
"description": "Boolean flag specifying whether `@pytest.mark.foo()` without parameters should have parentheses. If the option is set to `true` (the default), `@pytest.mark.foo()` is valid and `@pytest.mark.foo` is invalid. If set to `false`, `@pytest.fixture` is valid and `@pytest.mark.foo()` is invalid.",
"type": ["boolean", "null"]
},
"parametrize-names-type": {
"description": "Expected type for multiple argument names in `@pytest.mark.parametrize`. The following values are supported:\n\n- `csv` — a comma-separated list, e.g. `@pytest.mark.parametrize('name1,name2', ...)` - `tuple` (default) — e.g. `@pytest.mark.parametrize(('name1', 'name2'), ...)` - `list` — e.g. `@pytest.mark.parametrize(['name1', 'name2'], ...)`",
"anyOf": [
{
"$ref": "#/definitions/ParametrizeNameType"
},
{
"type": "null"
}
]
},
"parametrize-values-row-type": {
"description": "Expected type for each row of values in `@pytest.mark.parametrize` in case of multiple parameters. The following values are supported:\n\n- `tuple` (default) — e.g. `@pytest.mark.parametrize(('name1', 'name2'), [(1, 2), (3, 4)])` - `list` — e.g. `@pytest.mark.parametrize(('name1', 'name2'), [[1, 2], [3, 4]])`",
"anyOf": [
{
"$ref": "#/definitions/ParametrizeValuesRowType"
},
{
"type": "null"
}
]
},
"parametrize-values-type": {
"description": "Expected type for the list of values rows in `@pytest.mark.parametrize`. The following values are supported:\n\n- `tuple` — e.g. `@pytest.mark.parametrize('name', (1, 2, 3))` - `list` (default) — e.g. `@pytest.mark.parametrize('name', [1, 2, 3])`",
"anyOf": [
{
"$ref": "#/definitions/ParametrizeValuesType"
},
{
"type": "null"
}
]
},
"raises-extend-require-match-for": {
"description": "List of additional exception names that require a match= parameter in a `pytest.raises()` call. This extends the default list of exceptions that require a match= parameter. This option is useful if you want to extend the default list of exceptions that require a match= parameter without having to specify the entire list. Note that this option does not remove any exceptions from the default list.\n\nSupports glob patterns. For more information on the glob syntax, refer to the [`globset` documentation](https://docs.rs/globset/latest/globset/#syntax).",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"raises-require-match-for": {
"description": "List of exception names that require a match= parameter in a `pytest.raises()` call.\n\nSupports glob patterns. For more information on the glob syntax, refer to the [`globset` documentation](https://docs.rs/globset/latest/globset/#syntax).",
"type": ["array", "null"],
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Flake8QuotesOptions": {
"type": "object",
"properties": {
"avoid-escape": {
"description": "Whether to avoid using single quotes if a string contains single quotes, or vice-versa with double quotes, as per [PEP 8](https://peps.python.org/pep-0008/#string-quotes). This minimizes the need to escape quotation marks within strings.",
"type": ["boolean", "null"]
},
"docstring-quotes": {
"description": "Quote style to prefer for docstrings (either \"single\" or \"double\").\n\nWhen using the formatter, only \"double\" is compatible, as the formatter enforces double quotes for docstrings strings.",
"anyOf": [
{
"$ref": "#/definitions/Quote"
},
{
"type": "null"
}
]
},
"inline-quotes": {
"description": "Quote style to prefer for inline strings (either \"single\" or \"double\").\n\nWhen using the formatter, ensure that `format.quote-style` is set to the same preferred quote style.",
"anyOf": [
{
"$ref": "#/definitions/Quote"
},
{
"type": "null"
}
]
},
"multiline-quotes": {
"description": "Quote style to prefer for multiline strings (either \"single\" or \"double\").\n\nWhen using the formatter, only \"double\" is compatible, as the formatter enforces double quotes for multiline strings.",
"anyOf": [
{
"$ref": "#/definitions/Quote"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
"Flake8SelfOptions": {
"type": "object",
"properties": {
"extend-ignore-names": {
"description": "Additional names to ignore when considering `flake8-self` violations, in addition to those included in `ignore-names`.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"ignore-names": {
"description": "A list of names to ignore when considering `flake8-self` violations.",
"type": ["array", "null"],
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Flake8TidyImportsOptions": {
"type": "object",
"properties": {
"ban-relative-imports": {
"description": "Whether to ban all relative imports (`\"all\"`), or only those imports that extend into the parent module or beyond (`\"parents\"`).",
"anyOf": [
{
"$ref": "#/definitions/Strictness"
},
{
"type": "null"
}
]
},
"banned-api": {
"description": "Specific modules or module members that may not be imported or accessed. Note that this rule is only meant to flag accidental uses, and can be circumvented via `eval` or `importlib`.",
"type": ["object", "null"],
"additionalProperties": {
"$ref": "#/definitions/ApiBan"
}
},
"banned-module-level-imports": {
"description": "List of specific modules that may not be imported at module level, and should instead be imported lazily (e.g., within a function definition, or an `if TYPE_CHECKING:` block, or some other nested context).",
"type": ["array", "null"],
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"Flake8TypeCheckingOptions": {
"type": "object",
"properties": {
"exempt-modules": {
"description": "Exempt certain modules from needing to be moved into type-checking blocks.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"runtime-evaluated-base-classes": {
"description": "Exempt classes that list any of the enumerated classes as a base class from needing to be moved into type-checking blocks.\n\nCommon examples include Pydantic's `pydantic.BaseModel` and SQLAlchemy's `sqlalchemy.orm.DeclarativeBase`, but can also support user-defined classes that inherit from those base classes. For example, if you define a common `DeclarativeBase` subclass that's used throughout your project (e.g., `class Base(DeclarativeBase) ...` in `base.py`), you can add it to this list (`runtime-evaluated-base-classes = [\"base.Base\"]`) to exempt models from being moved into type-checking blocks.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"runtime-evaluated-decorators": {
"description": "Exempt classes decorated with any of the enumerated decorators from needing to be moved into type-checking blocks.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"strict": {
"description": "Enforce TC001, TC002, and TC003 rules even when valid runtime imports are present for the same module.\n\nSee flake8-type-checking's [strict](https://github.com/snok/flake8-type-checking#strict) option.",
"type": ["boolean", "null"]
}
},
"additionalProperties": false
},
"Flake8UnusedArgumentsOptions": {
"type": "object",
"properties": {
"ignore-variadic-names": {
"description": "Whether to allow unused variadic arguments, like `*args` and `**kwargs`.",
"type": ["boolean", "null"]
}
},
"additionalProperties": false
},
"FormatOptions": {
"description": "Experimental: Configures how `ruff format` formats your code.\n\nPlease provide feedback in [this discussion](https://github.com/astral-sh/ruff/discussions/7310).",
"type": "object",
"properties": {
"exclude": {
"description": "A list of file patterns to exclude from formatting in addition to the files excluded globally (see [`exclude`](#exclude), and [`extend-exclude`](#extend-exclude)).\n\nExclusions are based on globs, and can be either:\n\n- Single-path patterns, like `.mypy_cache` (to exclude any directory named `.mypy_cache` in the tree), `foo.py` (to exclude any file named `foo.py`), or `foo_*.py` (to exclude any file matching `foo_*.py` ). - Relative patterns, like `directory/foo.py` (to exclude that specific file) or `directory/*.py` (to exclude any Python files in `directory`). Note that these paths are relative to the project root (e.g., the directory containing your `pyproject.toml`).\n\nFor more information on the glob syntax, refer to the [`globset` documentation](https://docs.rs/globset/latest/globset/#syntax).",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"indent-style": {
"description": "Whether to use spaces or tabs for indentation.\n\n`indent-style = \"space\"` (default):\n\n```python def f(): print(\"Hello\") # Spaces indent the `print` statement. ```\n\n`indent-style = \"tab\"\"`:\n\n```python def f(): print(\"Hello\") # A tab `\\t` indents the `print` statement. ```\n\nPEP 8 recommends using spaces for [indentation](https://peps.python.org/pep-0008/#indentation). We care about accessibility; if you do not need tabs for accessibility, we do not recommend you use them.\n\nSee [`indent-width`](#indent-width) to configure the number of spaces per indentation and the tab width.",
"anyOf": [
{
"$ref": "#/definitions/IndentStyle"
},
{
"type": "null"
}
]
},
"line-ending": {
"description": "The character Ruff uses at the end of a line.\n\n* `auto`: The newline style is detected automatically on a file per file basis. Files with mixed line endings will be converted to the first detected line ending. Defaults to `\\n` for files that contain no line endings. * `lf`: Line endings will be converted to `\\n`. The default line ending on Unix. * `cr-lf`: Line endings will be converted to `\\r\\n`. The default line ending on Windows. * `native`: Line endings will be converted to `\\n` on Unix and `\\r\\n` on Windows.",
"anyOf": [
{
"$ref": "#/definitions/LineEnding"
},
{
"type": "null"
}
]
},
"preview": {
"description": "Whether to enable the unstable preview style formatting.",
"type": ["boolean", "null"]
},
"quote-style": {
"description": "Whether to prefer single `'` or double `\"` quotes for strings. Defaults to double quotes.\n\nIn compliance with [PEP 8](https://peps.python.org/pep-0008/) and [PEP 257](https://peps.python.org/pep-0257/), Ruff prefers double quotes for multiline strings and docstrings, regardless of the configured quote style.\n\nRuff may also deviate from this option if using the configured quotes would require escaping quote characters within the string. For example, given:\n\n```python a = \"a string without any quotes\" b = \"It's monday morning\" ```\n\nRuff will change `a` to use single quotes when using `quote-style = \"single\"`. However, `b` will be unchanged, as converting to single quotes would require the inner `'` to be escaped, which leads to less readable code: `'It\\'s monday morning'`.",
"anyOf": [
{
"$ref": "#/definitions/QuoteStyle"
},
{
"type": "null"
}
]
},
"skip-magic-trailing-comma": {
"description": "Ruff uses existing trailing commas as an indication that short lines should be left separate. If this option is set to `true`, the magic trailing comma is ignored.\n\nFor example, Ruff leaves the arguments separate even though collapsing the arguments to a single line doesn't exceed the line length if `skip-magic-trailing-comma = false`:\n\n```python # The arguments remain on separate lines because of the trailing comma after `b` def test( a, b, ): pass ```\n\nSetting `skip-magic-trailing-comma = true` changes the formatting to:\n\n```python # The arguments remain on separate lines because of the trailing comma after `b` def test(a, b): pass ```",
"type": ["boolean", "null"]
}
},
"additionalProperties": false
},
"ImportSection": {
"anyOf": [
{
"$ref": "#/definitions/ImportType"
},
{
"type": "string"
}
]
},
"ImportType": {
"type": "string",
"enum": [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder"
]
},
"IndentStyle": {
"oneOf": [
{
"description": "Use tabs to indent code.",
"type": "string",
"enum": ["tab"]
},
{
"description": "Use [`IndentWidth`] spaces to indent code.",
"type": "string",
"enum": ["space"]
}
]
},
"IndentWidth": {
"description": "The size of a tab.",
"type": "integer",
"format": "uint8",
"minimum": 1.0
},
"IsortOptions": {
"type": "object",
"properties": {
"case-sensitive": {
"description": "Sort imports taking into account case sensitivity.",
"type": ["boolean", "null"]
},
"classes": {
"description": "An override list of tokens to always recognize as a Class for `order-by-type` regardless of casing.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"combine-as-imports": {
"description": "Combines as imports on the same line. See isort's [`combine-as-imports`](https://pycqa.github.io/isort/docs/configuration/options.html#combine-as-imports) option.",
"type": ["boolean", "null"]
},
"constants": {
"description": "An override list of tokens to always recognize as a CONSTANT for `order-by-type` regardless of casing.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"detect-same-package": {
"description": "Whether to automatically mark imports from within the same package as first-party. For example, when `detect-same-package = true`, then when analyzing files within the `foo` package, any imports from within the `foo` package will be considered first-party.\n\nThis heuristic is often unnecessary when `src` is configured to detect all first-party sources; however, if `src` is _not_ configured, this heuristic can be useful to detect first-party imports from _within_ (but not _across_) first-party packages.",
"type": ["boolean", "null"]
},
"extra-standard-library": {
"description": "A list of modules to consider standard-library, in addition to those known to Ruff in advance.\n\nSupports glob patterns. For more information on the glob syntax, refer to the [`globset` documentation](https://docs.rs/globset/latest/globset/#syntax).",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"force-single-line": {
"description": "Forces all from imports to appear on their own line.",
"type": ["boolean", "null"]
},
"force-sort-within-sections": {
"description": "Don't sort straight-style imports (like `import sys`) before from-style imports (like `from itertools import groupby`). Instead, sort the imports by module, independent of import style.",
"type": ["boolean", "null"]
},
"force-to-top": {
"description": "Force specific imports to the top of their appropriate section.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"force-wrap-aliases": {
"description": "Force `import from` statements with multiple members and at least one alias (e.g., `import A as B`) to wrap such that every line contains exactly one member. For example, this formatting would be retained, rather than condensing to a single line:\n\n```python from .utils import ( test_directory as test_directory, test_id as test_id ) ```\n\nNote that this setting is only effective when combined with `combine-as-imports = true`. When `combine-as-imports` isn't enabled, every aliased `import from` will be given its own line, in which case, wrapping is not necessary.\n\nWhen using the formatter, ensure that `format.skip-magic-trailing-comma` is set to `false` (default) when enabling `force-wrap-aliases` to avoid that the formatter collapses members if they all fit on a single line.",
"type": ["boolean", "null"]
},
"forced-separate": {
"description": "A list of modules to separate into auxiliary block(s) of imports, in the order specified.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"from-first": {
"description": "Whether to place `import from` imports before straight imports when sorting.\n\nFor example, by default, imports will be sorted such that straight imports appear before `import from` imports, as in: ```python import os import sys from typing import List ```\n\nSetting `from-first = true` will instead sort such that `import from` imports appear before straight imports, as in: ```python from typing import List import os import sys ```",
"type": ["boolean", "null"]
},
"known-first-party": {
"description": "A list of modules to consider first-party, regardless of whether they can be identified as such via introspection of the local filesystem.\n\nSupports glob patterns. For more information on the glob syntax, refer to the [`globset` documentation](https://docs.rs/globset/latest/globset/#syntax).",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"known-local-folder": {
"description": "A list of modules to consider being a local folder. Generally, this is reserved for relative imports (`from . import module`).\n\nSupports glob patterns. For more information on the glob syntax, refer to the [`globset` documentation](https://docs.rs/globset/latest/globset/#syntax).",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"known-third-party": {
"description": "A list of modules to consider third-party, regardless of whether they can be identified as such via introspection of the local filesystem.\n\nSupports glob patterns. For more information on the glob syntax, refer to the [`globset` documentation](https://docs.rs/globset/latest/globset/#syntax).",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"length-sort": {
"description": "Sort imports by their string length, such that shorter imports appear before longer imports. For example, by default, imports will be sorted alphabetically, as in: ```python import collections import os ```\n\nSetting `length-sort = true` will instead sort such that shorter imports appear before longer imports, as in: ```python import os import collections ```",
"type": ["boolean", "null"]
},
"length-sort-straight": {
"description": "Sort straight imports by their string length. Similar to `length-sort`, but applies only to straight imports and doesn't affect `from` imports.",
"type": ["boolean", "null"]
},
"lines-after-imports": {
"description": "The number of blank lines to place after imports. Use `-1` for automatic determination.\n\nWhen using the formatter, only the values `-1`, `1`, and `2` are compatible because it enforces at least one empty and at most two empty lines after imports.",
"type": ["integer", "null"],
"format": "int"
},
"lines-between-types": {
"description": "The number of lines to place between \"direct\" and `import from` imports.\n\nWhen using the formatter, only the values `0` and `1` are compatible because it preserves up to one empty line after imports in nested blocks.",
"type": ["integer", "null"],
"format": "uint",
"minimum": 0.0
},
"no-lines-before": {
"description": "A list of sections that should _not_ be delineated from the previous section via empty lines.",
"type": ["array", "null"],
"items": {
"$ref": "#/definitions/ImportSection"
}
},
"no-sections": {
"description": "Put all imports into the same section bucket.\n\nFor example, rather than separating standard library and third-party imports, as in: ```python import os import sys\n\nimport numpy import pandas ```\n\nSetting `no-sections = true` will instead group all imports into a single section: ```python import os import numpy import pandas import sys ```",
"type": ["boolean", "null"]
},
"order-by-type": {
"description": "Order imports by type, which is determined by case, in addition to alphabetically.",
"type": ["boolean", "null"]
},
"relative-imports-order": {
"description": "Whether to place \"closer\" imports (fewer `.` characters, most local) before \"further\" imports (more `.` characters, least local), or vice versa.\n\nThe default (\"furthest-to-closest\") is equivalent to isort's `reverse-relative` default (`reverse-relative = false`); setting this to \"closest-to-furthest\" is equivalent to isort's `reverse-relative = true`.",
"anyOf": [
{
"$ref": "#/definitions/RelativeImportsOrder"
},
{
"type": "null"
}
]
},
"required-imports": {
"description": "Add the specified import line to all files.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"section-order": {
"description": "Override in which order the sections should be output. Can be used to move custom sections.",
"type": ["array", "null"],
"items": {
"$ref": "#/definitions/ImportSection"
}
},
"sections": {
"description": "A list of mappings from section names to modules. By default custom sections are output last, but this can be overridden with `section-order`.",
"type": ["object", "null"],
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"single-line-exclusions": {
"description": "One or more modules to exclude from the single line rule.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"split-on-trailing-comma": {
"description": "If a comma is placed after the last member in a multi-line import, then the imports will never be folded into one line.\n\nSee isort's [`split-on-trailing-comma`](https://pycqa.github.io/isort/docs/configuration/options.html#split-on-trailing-comma) option.\n\nWhen using the formatter, ensure that `format.skip-magic-trailing-comma` is set to `false` (default) when enabling `split-on-trailing-comma` to avoid that the formatter removes the trailing commas.",
"type": ["boolean", "null"]
},
"variables": {
"description": "An override list of tokens to always recognize as a var for `order-by-type` regardless of casing.",
"type": ["array", "null"],
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"LineEnding": {
"oneOf": [
{
"description": "The newline style is detected automatically on a file per file basis. Files with mixed line endings will be converted to the first detected line ending. Defaults to [`LineEnding::Lf`] for a files that contain no line endings.",
"type": "string",
"enum": ["auto"]
},
{
"description": "Line endings will be converted to `\\n` as is common on Unix.",
"type": "string",
"enum": ["lf"]
},
{
"description": "Line endings will be converted to `\\r\\n` as is common on Windows.",
"type": "string",
"enum": ["cr-lf"]
},
{
"description": "Line endings will be converted to `\\n` on Unix and `\\r\\n` on Windows.",
"type": "string",
"enum": ["native"]
}
]
},
"LineLength": {
"description": "The length of a line of text that is considered too long.\n\nThe allowed range of values is 1..=320",
"type": "integer",
"format": "uint16",
"maximum": 320.0,
"minimum": 1.0
},
"LintOptions": {
"description": "Experimental section to configure Ruff's linting. This new section will eventually replace the top-level linting options.\n\nOptions specified in the `lint` section take precedence over the top-level settings.",
"type": "object",
"properties": {
"allowed-confusables": {
"description": "A list of allowed \"confusable\" Unicode characters to ignore when enforcing `RUF001`, `RUF002`, and `RUF003`.",
"type": ["array", "null"],
"items": {
"type": "string",
"maxLength": 1,
"minLength": 1
}
},
"dummy-variable-rgx": {
"description": "A regular expression used to identify \"dummy\" variables, or those which should be ignored when enforcing (e.g.) unused-variable rules. The default expression matches `_`, `__`, and `_var`, but not `_var_`.",
"type": ["string", "null"]
},
"exclude": {
"description": "A list of file patterns to exclude from linting in addition to the files excluded globally (see [`exclude`](#exclude), and [`extend-exclude`](#extend-exclude)).\n\nExclusions are based on globs, and can be either:\n\n- Single-path patterns, like `.mypy_cache` (to exclude any directory named `.mypy_cache` in the tree), `foo.py` (to exclude any file named `foo.py`), or `foo_*.py` (to exclude any file matching `foo_*.py` ). - Relative patterns, like `directory/foo.py` (to exclude that specific file) or `directory/*.py` (to exclude any Python files in `directory`). Note that these paths are relative to the project root (e.g., the directory containing your `pyproject.toml`).\n\nFor more information on the glob syntax, refer to the [`globset` documentation](https://docs.rs/globset/latest/globset/#syntax).",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"explicit-preview-rules": {
"description": "Whether to require exact codes to select preview rules. When enabled, preview rules will not be selected by prefixes — the full code of each preview rule will be required to enable the rule.",
"type": ["boolean", "null"]
},
"extend-fixable": {
"description": "A list of rule codes or prefixes to consider fixable, in addition to those specified by `fixable`.",
"type": ["array", "null"],
"items": {
"$ref": "#/definitions/RuleSelector"
}
},
"extend-ignore": {
"description": "A list of rule codes or prefixes to ignore, in addition to those specified by `ignore`.",
"deprecated": true,
"type": ["array", "null"],
"items": {
"$ref": "#/definitions/RuleSelector"
}
},
"extend-per-file-ignores": {
"description": "A list of mappings from file pattern to rule codes or prefixes to exclude, in addition to any rules excluded by `per-file-ignores`.",
"type": ["object", "null"],
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/RuleSelector"
}
}
},
"extend-safe-fixes": {
"description": "A list of rule codes or prefixes for which unsafe fixes should be considered safe.",
"type": ["array", "null"],
"items": {
"$ref": "#/definitions/RuleSelector"
}
},
"extend-select": {
"description": "A list of rule codes or prefixes to enable, in addition to those specified by `select`.",
"type": ["array", "null"],
"items": {
"$ref": "#/definitions/RuleSelector"
}
},
"extend-unfixable": {
"description": "A list of rule codes or prefixes to consider non-auto-fixable, in addition to those specified by `unfixable`.",
"deprecated": true,
"type": ["array", "null"],
"items": {
"$ref": "#/definitions/RuleSelector"
}
},
"extend-unsafe-fixes": {
"description": "A list of rule codes or prefixes for which safe fixes should be considered unsafe.",
"type": ["array", "null"],
"items": {
"$ref": "#/definitions/RuleSelector"
}
},
"external": {
"description": "A list of rule codes or prefixes that are unsupported by Ruff, but should be preserved when (e.g.) validating `# noqa` directives. Useful for retaining `# noqa` directives that cover plugins not yet implemented by Ruff.",
"type": ["array", "null"],
"items": {
"type": "string"
}
},
"fixable": {
"description": "A list of rule codes or prefixes to consider fixable. By default, all rules are considered fixable.",
"type": ["array", "null"],
"items": {
"$ref": "#/definitions/RuleSelector"
}
},
"flake8-annotations": {
"description": "Options for the `flake8-annotations` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8AnnotationsOptions"
},
{
"type": "null"
}
]
},
"flake8-bandit": {
"description": "Options for the `flake8-bandit` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8BanditOptions"
},
{
"type": "null"
}
]
},
"flake8-bugbear": {
"description": "Options for the `flake8-bugbear` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8BugbearOptions"
},
{
"type": "null"
}
]
},
"flake8-builtins": {
"description": "Options for the `flake8-builtins` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8BuiltinsOptions"
},
{
"type": "null"
}
]
},
"flake8-comprehensions": {
"description": "Options for the `flake8-comprehensions` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8ComprehensionsOptions"
},
{
"type": "null"
}
]
},
"flake8-copyright": {
"description": "Options for the `flake8-copyright` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8CopyrightOptions"
},
{
"type": "null"
}
]
},
"flake8-errmsg": {
"description": "Options for the `flake8-errmsg` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8ErrMsgOptions"
},
{
"type": "null"
}
]
},
"flake8-gettext": {
"description": "Options for the `flake8-gettext` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8GetTextOptions"
},
{
"type": "null"
}
]
},
"flake8-implicit-str-concat": {
"description": "Options for the `flake8-implicit-str-concat` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8ImplicitStrConcatOptions"
},
{
"type": "null"
}
]
},
"flake8-import-conventions": {
"description": "Options for the `flake8-import-conventions` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8ImportConventionsOptions"
},
{
"type": "null"
}
]
},
"flake8-pytest-style": {
"description": "Options for the `flake8-pytest-style` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8PytestStyleOptions"
},
{
"type": "null"
}
]
},
"flake8-quotes": {
"description": "Options for the `flake8-quotes` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8QuotesOptions"
},
{
"type": "null"
}
]
},
"flake8-self": {
"description": "Options for the `flake8_self` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8SelfOptions"
},
{
"type": "null"
}
]
},
"flake8-tidy-imports": {
"description": "Options for the `flake8-tidy-imports` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8TidyImportsOptions"
},
{
"type": "null"
}
]
},
"flake8-type-checking": {
"description": "Options for the `flake8-type-checking` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8TypeCheckingOptions"
},
{
"type": "null"
}
]
},
"flake8-unused-arguments": {
"description": "Options for the `flake8-unused-arguments` plugin.",
"anyOf": [
{
"$ref": "#/definitions/Flake8UnusedArgumentsOptions"
},
{
"type": "null"
}
]
},
"ignore": {
"description": "A list of rule codes or prefixes to ignore. Prefixes can specify exact rules (like `F841`), entire categories (like `F`), or anything in between.\n\nWhen breaking ties between enabled and disabled rules (via `select` and `ignore`, respectively), more specific prefixes override less specific prefixes.",
"type": ["array", "null"],
"items": {