profiles.py 2.1 KB

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