pydocstringformatter icon indicating copy to clipboard operation
pydocstringformatter copied to clipboard

fix issue where passing two styles would fail with index error

Open jspaezp opened this issue 2 years ago β€’ 15 comments

Fixes the first section of:

Closes https://github.com/DanielNoord/pydocstringformatter/issues/160

jspaezp avatar Sep 10 '22 19:09 jspaezp

According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

github-actions[bot] avatar Sep 10 '22 19:09 github-actions[bot]

According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

github-actions[bot] avatar Sep 10 '22 19:09 github-actions[bot]

Codecov Report

Merging #162 (edf4976) into main (9268fd6) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #162   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          591       592    +1     
=========================================
+ Hits           591       592    +1     
Impacted Files Coverage Ξ”
pydocstringformatter/_formatting/base.py 100.00% <100.00%> (ΓΈ)
...stringformatter/_formatting/formatters_numpydoc.py 100.00% <100.00%> (ΓΈ)

codecov[bot] avatar Sep 10 '22 19:09 codecov[bot]

Tests fail due to the auto-fix from pre-commit.ci 0c6795b437e01d62e2134eb8efd6099b59e54777 ... which raises the question ... why is it generating those trailing whitespaces?

  • Should a "two pass" approach be done?
  • Should there be an "Extras" where everything that was not placed in a section would go?

jspaezp avatar Sep 10 '22 19:09 jspaezp

  • Should a "two pass" approach be done?

I have been thinking about this as well, but not sure if we should do that as we can create infinite loops.

Those trailing whitespaces seem to match the previous indentation. I think that is a bug and should only be a new line without the extra spacing.

DanielNoord avatar Sep 12 '22 07:09 DanielNoord

According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

github-actions[bot] avatar Sep 12 '22 08:09 github-actions[bot]

According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

github-actions[bot] avatar Sep 12 '22 21:09 github-actions[bot]

@DanielNoord What about this behavior? Where there is a section separator but no name. I think it makes clear that the parser was not able to assign what is under it to any section and not that it is part of the former.

Those trailing whitespaces seem to match the previous indentation. I think that is a bug and should only be a new line without the extra spacing.

jspaezp avatar Sep 12 '22 21:09 jspaezp

According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

github-actions[bot] avatar Sep 12 '22 21:09 github-actions[bot]

@DanielNoord

  • Should a "two pass" approach be done?

I have been thinking about this as well, but not sure if we should do that as we can create infinite loops.

Those trailing whitespaces seem to match the previous indentation. I think that is a bug and should only be a new line without the extra spacing.

Thinking about this ... I started working a branch that does a two pass to check the stability of the tokens. I will reference it in a new issue.

jspaezp avatar Sep 16 '22 00:09 jspaezp

Was this replaced by #169 @jspaezp ? (Should we close ?)

Pierre-Sassoulas avatar May 01 '23 11:05 Pierre-Sassoulas

Hello @Pierre-Sassoulas! sorry for not closing this issue before (just for the future, it was fixed here https://github.com/DanielNoord/pydocstringformatter/pull/163)

jspaezp avatar May 02 '23 06:05 jspaezp

No problem, thank you for answering :) !

Pierre-Sassoulas avatar May 02 '23 07:05 Pierre-Sassoulas

I do think this test still fails on main? At least it did last time I checked after we merged #163.

Edit: this does indeed still reproduce.

DanielNoord avatar May 02 '23 07:05 DanielNoord

According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

github-actions[bot] avatar May 15 '23 22:05 github-actions[bot]