profiles.py 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 = black.copy()
  36. plone.update(
  37. {
  38. "force_alphabetical_sort": True,
  39. "force_single_line": True,
  40. "lines_after_imports": 2,
  41. }
  42. )
  43. attrs = {
  44. "atomic": True,
  45. "force_grid_wrap": 0,
  46. "include_trailing_comma": True,
  47. "lines_after_imports": 2,
  48. "lines_between_types": 1,
  49. "multi_line_output": 3,
  50. "use_parentheses": True,
  51. }
  52. hug = {
  53. "multi_line_output": 3,
  54. "include_trailing_comma": True,
  55. "force_grid_wrap": 0,
  56. "use_parentheses": True,
  57. "line_length": 100,
  58. }
  59. wemake = {
  60. "multi_line_output": 3,
  61. "include_trailing_comma": True,
  62. "use_parentheses": True,
  63. "line_length": 80,
  64. }
  65. appnexus = {
  66. **black,
  67. "force_sort_within_sections": True,
  68. "order_by_type": False,
  69. "case_sensitive": False,
  70. "reverse_relative": True,
  71. "sort_relative_in_force_sorted_sections": True,
  72. "sections": ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "APPLICATION", "LOCALFOLDER"],
  73. "no_lines_before": "LOCALFOLDER",
  74. }
  75. profiles: Dict[str, Dict[str, Any]] = {
  76. "black": black,
  77. "django": django,
  78. "pycharm": pycharm,
  79. "google": google,
  80. "open_stack": open_stack,
  81. "plone": plone,
  82. "attrs": attrs,
  83. "hug": hug,
  84. "wemake": wemake,
  85. "appnexus": appnexus,
  86. }