prettycsharp 1.1.2__tar.gz → 1.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/CHANGELOG.md +5 -0
  2. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/PKG-INFO +1 -1
  3. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/__init__.py +1 -1
  4. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/printer/declarations.py +5 -2
  5. prettycsharp-1.1.3/tests/fuzz_corpus/csharp/comment_only_accessor_list.cs +0 -0
  6. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_layout.py +20 -0
  7. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.gitattributes +0 -0
  8. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/codeql/codeql-config.yml +0 -0
  9. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/dependabot.yml +0 -0
  10. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/build.in +0 -0
  11. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/build.txt +0 -0
  12. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/fuzz.in +0 -0
  13. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/fuzz.txt +0 -0
  14. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/pip-audit.in +0 -0
  15. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/pip-audit.txt +0 -0
  16. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/runtime.in +0 -0
  17. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/runtime.txt +0 -0
  18. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/test.in +0 -0
  19. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/test.txt +0 -0
  20. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/zizmor.in +0 -0
  21. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/requirements/zizmor.txt +0 -0
  22. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/security/accepted.toml +0 -0
  23. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/security/clamav/Dockerfile +0 -0
  24. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/security/malware-accepted.toml +0 -0
  25. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/security/semgrep/Dockerfile +0 -0
  26. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/security/yara.json +0 -0
  27. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/security/yara_update.py +0 -0
  28. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/workflows/auto-merge.yml +0 -0
  29. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/workflows/ci.yml +0 -0
  30. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/workflows/fuzz.yml +0 -0
  31. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/workflows/malware-scan.yml +0 -0
  32. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/workflows/publish.yml +0 -0
  33. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/workflows/scorecard.yml +0 -0
  34. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/workflows/security.yml +0 -0
  35. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/workflows/update-yara-rules.yml +0 -0
  36. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.github/zizmor.yml +0 -0
  37. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/.gitignore +0 -0
  38. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/AGENTS.md +0 -0
  39. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/CLAUDE.md +0 -0
  40. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/DESIGN.md +0 -0
  41. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/LICENSE +0 -0
  42. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/README.md +0 -0
  43. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/SECURITY.md +0 -0
  44. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/fuzz/fuzz_formatter.py +0 -0
  45. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/pyproject.toml +0 -0
  46. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/scripts/security/malware_report.py +0 -0
  47. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/scripts/security/security_report.py +0 -0
  48. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/__main__.py +0 -0
  49. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/cli.py +0 -0
  50. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/conditional.py +0 -0
  51. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/config.py +0 -0
  52. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/doc.py +0 -0
  53. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/formatter.py +0 -0
  54. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/ignore.py +0 -0
  55. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/isolate.py +0 -0
  56. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/parsing.py +0 -0
  57. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/printer/__init__.py +0 -0
  58. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/printer/core.py +0 -0
  59. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/printer/expressions.py +0 -0
  60. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/printer/statements.py +0 -0
  61. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/project.py +0 -0
  62. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/py.typed +0 -0
  63. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/rewrites.py +0 -0
  64. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/settings.py +0 -0
  65. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/syntax.py +0 -0
  66. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/src/prettycsharp/verify.py +0 -0
  67. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/fuzz_corpus/csharp/declarations.cs +0 -0
  68. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/fuzz_corpus/csharp/directives.cs +0 -0
  69. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/fuzz_corpus/csharp/embedded_statements.cs +0 -0
  70. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/fuzz_corpus/csharp/expressions.cs +0 -0
  71. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/fuzz_corpus/csharp/members.cs +0 -0
  72. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/fuzz_corpus/csharp/order.cs +0 -0
  73. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/fuzz_corpus/csharp/queries_and_patterns.cs +0 -0
  74. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/fuzz_corpus/csharp/split_by_conditionals.cs +0 -0
  75. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/fuzz_corpus/csharp/statements.cs +0 -0
  76. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/fuzz_corpus/csharp/strings.cs +0 -0
  77. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/support.py +0 -0
  78. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_cli.py +0 -0
  79. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_conditional.py +0 -0
  80. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_config.py +0 -0
  81. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_doc.py +0 -0
  82. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_docs.py +0 -0
  83. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_format_around.py +0 -0
  84. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_fuzz_corpus.py +0 -0
  85. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_ignore.py +0 -0
  86. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_parsing.py +0 -0
  87. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_project.py +0 -0
  88. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_rewrites.py +0 -0
  89. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_settings.py +0 -0
  90. {prettycsharp-1.1.2 → prettycsharp-1.1.3}/tests/test_verify.py +0 -0
@@ -2,6 +2,11 @@
2
2
 
3
3
  Each release's section becomes the body of its GitHub release.
4
4
 
5
+ ## [1.1.3] - 2026-10-17
6
+
7
+ - A property's accessor list or an enum that holds only a comment no longer
8
+ gains a blank line each time the file is formatted. Found by fuzzing.
9
+
5
10
  ## [1.1.2] - 2026-10-17
6
11
 
7
12
  - Nothing is padded into columns by default any more: `align_assignments`,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: prettycsharp
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: An opinionated formatter for C#, in the spirit of Prettier
5
5
  Project-URL: Homepage, https://github.com/WilliamSmithEdward/prettyCSharp
6
6
  Project-URL: Repository, https://github.com/WilliamSmithEdward/prettyCSharp
@@ -4,7 +4,7 @@ from prettycsharp.formatter import FormatResult, FormattingError, format_details
4
4
  from prettycsharp.parsing import CSharpSyntaxError
5
5
  from prettycsharp.settings import Settings, SettingsError
6
6
 
7
- __version__ = "1.1.2"
7
+ __version__ = "1.1.3"
8
8
 
9
9
  __all__ = [
10
10
  "CSharpSyntaxError",
@@ -399,7 +399,7 @@ class Declarations(Statements):
399
399
  return [
400
400
  self.open_brace("type"),
401
401
  self.tok(open_tok),
402
- indent([HARDLINE, lines]),
402
+ indent([HARDLINE, lines]) if lines else "",
403
403
  self.close_comments(close_tok),
404
404
  HARDLINE,
405
405
  self.tok(close_tok, leading=False),
@@ -522,10 +522,13 @@ class Declarations(Statements):
522
522
  return [" ", self.tok(open_tok), " ", join(" ", [self.print(a) for a in accessors]), " ", self.tok(close_tok)]
523
523
  if not accessors and not close_tok.leading:
524
524
  return [" ", self.tok(open_tok), " ", self.tok(close_tok)]
525
+ body: Doc = ""
526
+ if accessors:
527
+ body = indent([HARDLINE, self.print_list(accessors, lambda a, b: self.has_blank_before(b))])
525
528
  return [
526
529
  self.open_brace("accessor"),
527
530
  self.tok(open_tok),
528
- indent([HARDLINE, self.print_list(accessors, lambda a, b: self.has_blank_before(b))]),
531
+ body,
529
532
  self.close_comments(close_tok),
530
533
  HARDLINE,
531
534
  self.tok(close_tok, leading=False),
@@ -707,6 +707,26 @@ def test_obvious_parentheses_are_removed_and_clarifying_ones_kept() -> None:
707
707
  )
708
708
 
709
709
 
710
+ def test_accessor_list_and_enum_holding_only_a_comment() -> None:
711
+ check(
712
+ "class C { int P {\n// c\n} }\nenum E {\n// c\n}\n",
713
+ """
714
+ class C
715
+ {
716
+ int P
717
+ {
718
+ // c
719
+ }
720
+ }
721
+
722
+ enum E
723
+ {
724
+ // c
725
+ }
726
+ """,
727
+ )
728
+
729
+
710
730
  def test_auto_properties_and_empty_bodies_stay_on_one_line() -> None:
711
731
  check(
712
732
  """
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes