ruff
d7c74846 - Format function argument separator comments (#5211)

Comment changes are shownComment changes are hidden
Commit
1 year ago
Format function argument separator comments (#5211) ## Summary This is a complete rewrite of the handling of `/` and `*` comment handling in function signatures. The key problem is that slash and star don't have a note. We now parse out the positions of slash and star and their respective preceding and following note. I've left code comments for each possible case of function signature structure and comment placement ## Test Plan I extended the function statement fixtures with cases that i found. If you have more weird edge cases your input would be appreciated.
Author
Parents
  • crates/ruff_python_formatter
    • resources/test/fixtures/ruff/statement
      • File
        function.py
    • src
      • comments
        • File
          placement.rs
      • other
        • File
          arguments.rs
      • snapshots
        • ruff_python_formatter__tests__ruff_test__statement__function_py.snap
Loading