profiles.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. """Common profiles are defined here to be easily used within a project using --profile {name}"""
  2. from typing import Any
  3. black = {
  4. "multi_line_output": 3,
  5. "include_trailing_comma": True,
  6. "split_on_trailing_comma": True,
  7. "force_grid_wrap": 0,
  8. "use_parentheses": True,
  9. "ensure_newline_before_comments": True,
  10. "line_length": 88,
  11. }
  12. django = {
  13. "combine_as_imports": True,
  14. "include_trailing_comma": True,
  15. "multi_line_output": 5,
  16. "line_length": 79,
  17. }
  18. pycharm = {
  19. "multi_line_output": 3,
  20. "force_grid_wrap": 2,
  21. "lines_after_imports": 2,
  22. }
  23. google = {
  24. "force_single_line": True,
  25. "force_sort_within_sections": True,
  26. "lexicographical": True,
  27. "line_length": 1000,
  28. "single_line_exclusions": (
  29. "collections.abc",
  30. "six.moves",
  31. "typing",
  32. "typing_extensions",
  33. ),
  34. "order_by_type": False,
  35. "group_by_package": True,
  36. }
  37. open_stack = {
  38. "force_single_line": True,
  39. "force_sort_within_sections": True,
  40. "lexicographical": True,
  41. }
  42. plone = black.copy()
  43. plone.update(
  44. {
  45. "force_alphabetical_sort": True,
  46. "force_single_line": True,
  47. }
  48. )
  49. attrs = {
  50. "atomic": True,
  51. "force_grid_wrap": 0,
  52. "include_trailing_comma": True,
  53. "lines_after_imports": 2,
  54. "lines_between_types": 1,
  55. "multi_line_output": 3,
  56. "use_parentheses": True,
  57. }
  58. hug = {
  59. "multi_line_output": 3,
  60. "include_trailing_comma": True,
  61. "force_grid_wrap": 0,
  62. "use_parentheses": True,
  63. "line_length": 100,
  64. }
  65. wemake = {
  66. "multi_line_output": 3,
  67. "include_trailing_comma": True,
  68. "use_parentheses": True,
  69. "line_length": 80,
  70. }
  71. appnexus = {
  72. **black,
  73. "force_sort_within_sections": True,
  74. "order_by_type": False,
  75. "case_sensitive": False,
  76. "reverse_relative": True,
  77. "sort_relative_in_force_sorted_sections": True,
  78. "sections": ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "APPLICATION", "LOCALFOLDER"],
  79. "no_lines_before": "LOCALFOLDER",
  80. }
  81. profiles: dict[str, dict[str, Any]] = {
  82. "black": black,
  83. "django": django,
  84. "pycharm": pycharm,
  85. "google": google,
  86. "open_stack": open_stack,
  87. "plone": plone,
  88. "attrs": attrs,
  89. "hug": hug,
  90. "wemake": wemake,
  91. "appnexus": appnexus,
  92. }