Closed rmartin16 closed 1 year ago
@rmartin16 should be fixed in v1.7.2-rc5.
Good deal; I'm seeing the examples above now extending the docs for :params xxx:
to the specified line length.
Although, it seems it can be a little over-aggressive when compressing in to one line. It appears the underlying problem is only the docs for the parameter are being compared to the line length instead of how long the entire line will become when composed.
class Example:
def _write_requirements_file(self, app, requires, requirements_path):
"""Configure application requirements by writing a requirements.txt file.
:param app: The app configuration
:param requires: The full list of requirements
- :param requirements_path: The full path to a requirements.txt file that
- will be written.
+ :param requirements_path: The full path to a requirements.txt file that will be written.
"""
class Example:
def _build_app(self, app, update, update_requirements, update_resources, update_support, no_update, test_mode, **options):
"""Internal method to invoke a build on a single app. Ensures the app exists,
and has been updated (if requested) before attempting to issue the actual build
command.
:param app: The application to build
:param update: Should the application be updated before building?
- :param update_requirements: Should the application requirements be
- updated before building?
- :param update_resources: Should the application resources be updated
- before building?
+ :param update_requirements: Should the application requirements be updated before building?
+ :param update_resources: Should the application resources be updated before building?
:param update_support: Should the application support be updated?
:param no_update: Should automated updates be disabled?
:param test_mode: Is the app being build in test mode?
class Example:
def update_emulator_config(self, avd, updates):
"""Update the AVD configuration with specific values.
:params avd: The AVD whose config will be updated
- :params updates: A dictionary containing the new key-value to
- add to the device configuration.
+ :params updates: A dictionary containing the new key-value to add to the device configuration.
"""
@rmartin16 you were correct, the field name wasn't being accounted for in the length of the line. Should be fixed in v1.7.2-rc6.
That fixes it. Thanks.
Closing this issue to #231.
While testing out v1.7.2-rc4, I realized the reformatted text wasn't always being reformatted to reach the specified line length.
In these examples, the line length is being controlled by the
--black
setting to a length of 88. It appears there is some length setting that is triggering the reflow of the:param xxx:
docs...but it doesn't seem to be the same length controlling how other parts of the docs are changed.The body of the docstring here is reformatted to reach 88 chars:
Here again we see the body being reformatted to 88 chars but the
param xxx:
docs, while being reformatted, are not being extended to reach the length limit:Additionally, if I manually reflow these
:param xxx:
docs to the 88 char max, docformatter doesn't attempt to shorten them: