Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically Format Docstrings #428

Merged
merged 7 commits into from
Sep 10, 2020
Merged

Automatically Format Docstrings #428

merged 7 commits into from
Sep 10, 2020

Conversation

danyeaw
Copy link
Member

@danyeaw danyeaw commented Sep 7, 2020

This PR add docformatter to automatically reformat our docstrings.

I also found found some out of date docstring using darglint, and reformatted the code in our docstrings using blackdoc.

Signed-off-by: Dan Yeaw <dan@yeaw.me>
Signed-off-by: Dan Yeaw <dan@yeaw.me>
Signed-off-by: Dan Yeaw <dan@yeaw.me>
Signed-off-by: Dan Yeaw <dan@yeaw.me>
@github-actions github-actions bot added the chore Maintenance related PR label Sep 7, 2020
@danyeaw danyeaw changed the title chore/format-docstrings Automatically Format Docstrings Sep 7, 2020
chore/format-docstrings (Sourcery refactored)
@amolenaar amolenaar merged commit 970d146 into master Sep 10, 2020
@amolenaar amolenaar deleted the chore/format-docstrings branch September 10, 2020 05:52
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 10, 2020

Sourcery Code Quality Report (beta)

Merging this PR leaves code quality unchanged.

Quality metrics Before After Change
Complexity 1.48 1.48 0.00
Method Length 43.19 43.19 0.00
Quality 8.86 8.86 0.00
Other metrics Before After Change
Lines 25344 24660 -684
Changed files Quality Before Quality After Quality Change
examples/list_classes.py 8.78 8.78 0.00
gaphor/init.py 9.95 9.95 0.00
gaphor/abc.py 9.69 9.69 0.00
gaphor/action.py 9.32 9.32 0.00
gaphor/application.py 9.18 9.18 0.00
gaphor/entrypoint.py 8.31 8.31 0.00
gaphor/event.py 9.63 9.63 0.00
gaphor/i18n.py 9.70 9.70 0.00
gaphor/transaction.py 9.21 9.21 0.00
gaphor/SysML/modelinglanguage.py 9.72 9.72 0.00
gaphor/SysML/propertypages.py 9.17 9.17 0.00
gaphor/SysML/blocks/connectors.py 9.08 9.08 0.00
gaphor/SysML/blocks/grouping.py 9.51 9.51 0.00
gaphor/SysML/requirements/connectors.py 9.31 9.31 0.00
gaphor/UML/diagramitems.py 9.55 9.55 0.00
gaphor/UML/modelfactory.py 8.76 8.76 0.00
gaphor/UML/modelinglanguage.py 9.73 9.73 0.00
gaphor/UML/sanitizerservice.py 8.55 8.55 0.00
gaphor/UML/umlfmt.py 8.36 8.36 0.00
gaphor/UML/umllex.py 8.14 8.14 0.00
gaphor/UML/umloverrides.py 9.21 9.21 0.00
gaphor/UML/actions/action.py 8.60 8.60 0.00
gaphor/UML/actions/actionsgrouping.py 9.10 9.10 0.00
gaphor/UML/actions/activitynodes.py 8.75 8.75 0.00
gaphor/UML/actions/flow.py 8.71 8.71 0.00
gaphor/UML/actions/flowconnect.py 8.35 8.35 0.00
gaphor/UML/actions/objectnode.py 8.97 8.97 0.00
gaphor/UML/actions/partition.py 7.45 7.45 0.00
gaphor/UML/actions/tests/test_action.py 9.75 9.75 0.00
gaphor/UML/actions/tests/test_activitynodes.py 8.99 8.99 0.00
gaphor/UML/actions/tests/test_flow.py 9.29 9.29 0.00
gaphor/UML/actions/tests/test_flowconnect.py 7.87 7.87 0.00
gaphor/UML/actions/tests/test_grouping.py 8.16 8.16 0.00
gaphor/UML/actions/tests/test_objectnode.py 9.46 9.46 0.00
gaphor/UML/classes/association.py 8.76 8.76 0.00
gaphor/UML/classes/classconnect.py 8.48 8.48 0.00
gaphor/UML/classes/classespropertypages.py 8.85 8.85 0.00
gaphor/UML/classes/dependency.py 9.13 9.13 0.00
gaphor/UML/classes/generalization.py 9.28 9.28 0.00
gaphor/UML/classes/implementation.py 8.93 8.93 0.00
gaphor/UML/classes/interface.py 8.00 8.00 0.00
gaphor/UML/classes/interfaceconnect.py 9.28 9.28 0.00
gaphor/UML/classes/klass.py 8.55 8.55 0.00
gaphor/UML/classes/package.py 8.31 8.31 0.00
gaphor/UML/classes/stereotype.py 9.21 9.21 0.00
gaphor/UML/classes/tests/test_association.py 8.63 8.63 0.00
gaphor/UML/classes/tests/test_class.py 8.48 8.48 0.00
gaphor/UML/classes/tests/test_classconnect.py 7.94 7.94 0.00
gaphor/UML/classes/tests/test_implementationconnect.py 8.81 8.81 0.00
gaphor/UML/classes/tests/test_interface.py 9.41 9.41 0.00
gaphor/UML/classes/tests/test_interfaceconnect.py 8.98 8.98 0.00
gaphor/UML/components/artifact.py 8.26 8.26 0.00
gaphor/UML/components/component.py 7.99 7.99 0.00
gaphor/UML/components/componentsgrouping.py 9.14 9.14 0.00
gaphor/UML/components/componentspropertypage.py 9.44 9.44 0.00
gaphor/UML/components/connector.py 9.03 9.03 0.00
gaphor/UML/components/connectorconnect.py 8.21 8.21 0.00
gaphor/UML/components/node.py 8.50 8.50 0.00
gaphor/UML/components/tests/test_connect.py 8.45 8.45 0.00
gaphor/UML/components/tests/test_connector.py 9.35 9.35 0.00
gaphor/UML/components/tests/test_grouping.py 8.60 8.60 0.00
gaphor/UML/interactions/executionspecification.py 8.98 8.98 0.00
gaphor/UML/interactions/interaction.py 8.57 8.57 0.00
gaphor/UML/interactions/interactionsconnect.py 8.33 8.33 0.00
gaphor/UML/interactions/interactionsgrouping.py 9.60 9.60 0.00
gaphor/UML/interactions/interactionspropertypages.py 8.68 8.68 0.00
gaphor/UML/interactions/lifeline.py 8.77 8.77 0.00
gaphor/UML/interactions/message.py 8.62 8.62 0.00
gaphor/UML/interactions/tests/test_message.py 9.35 9.35 0.00
gaphor/UML/interactions/tests/test_messageconnect.py 8.47 8.47 0.00
gaphor/UML/profiles/extension.py 9.09 9.09 0.00
gaphor/UML/profiles/extensionconnect.py 7.50 7.50 0.00
gaphor/UML/profiles/metaclasspropertypage.py 9.06 9.06 0.00
gaphor/UML/profiles/stereotypepropertypages.py 8.38 8.38 0.00
gaphor/UML/profiles/tests/test_classifier_stereotypes.py 8.29 8.29 0.00
gaphor/UML/profiles/tests/test_extensionconnect.py 9.02 9.02 0.00
gaphor/UML/states/init.py 9.48 9.48 0.00
gaphor/UML/states/finalstate.py 8.58 8.58 0.00
gaphor/UML/states/pseudostates.py 8.79 8.79 0.00
gaphor/UML/states/state.py 7.86 7.86 0.00
gaphor/UML/states/transition.py 8.72 8.72 0.00
gaphor/UML/states/vertexconnect.py 8.79 8.79 0.00
gaphor/UML/states/tests/test_pseudostates.py 9.58 9.58 0.00
gaphor/UML/states/tests/test_states.py 8.96 8.96 0.00
gaphor/UML/states/tests/test_transition.py 8.88 8.88 0.00
gaphor/UML/states/tests/test_transition_connect.py 8.23 8.23 0.00
gaphor/UML/tests/test_sanitizerservice.py 8.50 8.50 0.00
gaphor/UML/tests/test_uml2.py 9.10 9.10 0.00
gaphor/UML/tests/test_umlfmt.py 9.05 9.05 0.00
gaphor/UML/tests/test_umllex.py 8.91 8.91 0.00
gaphor/UML/usecases/actor.py 7.95 7.95 0.00
gaphor/UML/usecases/extend.py 9.30 9.30 0.00
gaphor/UML/usecases/include.py 9.30 9.30 0.00
gaphor/UML/usecases/usecase.py 8.95 8.95 0.00
gaphor/UML/usecases/usecaseconnect.py 9.40 9.40 0.00
gaphor/UML/usecases/tests/test_extend.py 8.76 8.76 0.00
gaphor/UML/usecases/tests/test_include.py 8.76 8.76 0.00
gaphor/codegen/codegen.py 8.99 8.99 0.00
gaphor/codegen/override.py 8.67 8.67 0.00
gaphor/codegen/profile_coder.py 7.72 7.72 0.00
gaphor/codegen/uml_coder.py 7.88 7.88 0.00
gaphor/codegen/writer.py 7.55 7.55 0.00
gaphor/codegen/tests/test_profile_coder.py 9.00 9.00 0.00
gaphor/core/init.py 9.73 9.73 0.00
gaphor/core/eventmanager.py 9.52 9.52 0.00
gaphor/core/modeling/collection.py 9.58 9.58 0.00
gaphor/core/modeling/coremodel.py 8.87 8.87 0.00
gaphor/core/modeling/diagram.py 9.14 9.14 0.00
gaphor/core/modeling/element.py 9.53 9.53 0.00
gaphor/core/modeling/elementdispatcher.py 8.12 8.12 0.00
gaphor/core/modeling/elementfactory.py 9.35 9.35 0.00
gaphor/core/modeling/event.py 9.62 9.62 0.00
gaphor/core/modeling/listmixins.py 9.23 9.23 0.00
gaphor/core/modeling/presentation.py 9.49 9.49 0.00
gaphor/core/modeling/properties.py 9.06 9.06 0.00
gaphor/core/modeling/tests/test_collection.py 9.42 9.42 0.00
gaphor/core/modeling/tests/test_elementdispatcher.py 8.79 8.79 0.00
gaphor/core/styling/declarations.py 8.90 8.90 0.00
gaphor/core/styling/parser.py 9.00 9.00 0.00
gaphor/core/styling/properties.py 7.10 7.10 0.00
gaphor/core/styling/selectors.py 8.81 8.81 0.00
gaphor/diagram/init.py 9.75 9.75 0.00
gaphor/diagram/connectors.py 9.11 9.11 0.00
gaphor/diagram/copypaste.py 8.96 8.96 0.00
gaphor/diagram/diagramtoolbox.py 8.71 8.71 0.00
gaphor/diagram/diagramtools.py 8.42 8.42 0.00
gaphor/diagram/grouping.py 9.75 9.75 0.00
gaphor/diagram/inlineeditors.py 8.45 8.45 0.00
gaphor/diagram/painter.py 8.95 8.95 0.00
gaphor/diagram/presentation.py 8.91 8.91 0.00
gaphor/diagram/propertypages.py 9.28 9.28 0.00
gaphor/diagram/shapes.py 8.76 8.76 0.00
gaphor/diagram/support.py 9.67 9.67 0.00
gaphor/diagram/text.py 8.24 8.24 0.00
gaphor/diagram/general/comment.py 8.45 8.45 0.00
gaphor/diagram/general/connectors.py 7.96 7.96 0.00
gaphor/diagram/general/simpleitem.py 9.15 9.15 0.00
gaphor/diagram/general/tests/test_comment.py 8.51 8.51 0.00
gaphor/diagram/general/tests/test_simpleitem.py 9.71 9.71 0.00
gaphor/diagram/tests/fixtures.py 9.20 9.20 0.00
gaphor/diagram/tests/test_text.py 8.44 8.44 0.00
gaphor/plugins/console/console.py 8.85 8.85 0.00
gaphor/plugins/console/consolewindow.py 9.08 9.08 0.00
gaphor/plugins/diagramexport/init.py 8.84 8.84 0.00
gaphor/plugins/diagramexport/gaphorconvert.py 7.90 7.90 0.00
gaphor/plugins/xmiexport/init.py 9.07 9.07 0.00
gaphor/services/componentregistry.py 9.40 9.40 0.00
gaphor/services/copyservice.py 8.91 8.91 0.00
gaphor/services/modelinglanguage.py 9.54 9.54 0.00
gaphor/services/properties.py 9.37 9.37 0.00
gaphor/services/session.py 9.79 9.79 0.00
gaphor/services/undomanager.py 9.21 9.21 0.00
gaphor/services/helpservice/init.py 9.35 9.35 0.00
gaphor/services/tests/test_copyservice.py 8.56 8.56 0.00
gaphor/services/tests/test_undomanager.py 8.06 8.06 0.00
gaphor/storage/parser.py 9.08 9.08 0.00
gaphor/storage/storage.py 7.71 7.71 0.00
gaphor/storage/verify.py 8.59 8.59 0.00
gaphor/storage/xmlwriter.py 9.06 9.06 0.00
gaphor/storage/tests/conftest.py 9.39 9.39 0.00
gaphor/storage/tests/test_storage.py 8.25 8.25 0.00
gaphor/storage/tests/test_storage_message_item_upgrade.py 8.74 8.74 0.00
gaphor/tests/testcase.py 9.16 9.16 0.00
gaphor/ui/init.py 8.46 8.46 0.00
gaphor/ui/abc.py 9.80 9.80 0.00
gaphor/ui/appfilemanager.py 9.32 9.32 0.00
gaphor/ui/diagrampage.py 8.73 8.73 0.00
gaphor/ui/elementeditor.py 9.11 9.11 0.00
gaphor/ui/errorhandler.py 8.27 8.27 0.00
gaphor/ui/event.py 9.72 9.72 0.00
gaphor/ui/filedialog.py 9.08 9.08 0.00
gaphor/ui/filemanager.py 8.70 8.70 0.00
gaphor/ui/gidlethread.py 9.31 9.31 0.00
gaphor/ui/iconname.py 9.72 9.72 0.00
gaphor/ui/layout.py 8.62 8.62 0.00
gaphor/ui/mainwindow.py 8.83 8.83 0.00
gaphor/ui/menufragment.py 9.61 9.61 0.00
gaphor/ui/namespace.py 8.19 8.19 0.00
gaphor/ui/questiondialog.py 9.63 9.63 0.00
gaphor/ui/statuswindow.py 9.01 9.01 0.00
gaphor/ui/toolbox.py 8.83 8.83 0.00
gaphor/ui/tests/test_handletool.py 8.73 8.73 0.00
tests/test_action_issue.py 7.28 7.28 0.00
tests/test_load_model.py 9.49 9.49 0.00
tests/test_multiple_associations.py 8.62 8.62 0.00
tests/test_undo.py 8.98 8.98 0.00
win-installer/hooks/hook-gi.repository.HarfBuzz.py 9.68 9.68 0.00
win-installer/hooks/hook-tinycss2.py 9.80 9.80 0.00
win-installer/hooks/pre_safe_import_module/hook-gi.repository.HarfBuzz.py 9.85 9.85 0.00
win-installer/misc/create-launcher.py 8.81 8.81 0.00
win-installer/misc/depcheck.py 8.38 8.38 0.00

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Overall Recommendation
gaphor/codegen/uml_coder.py generate 85 697.43 0.33 Reduce complexity. Split out functionality
gaphor/core/modeling/properties.py derivedunion.propagate 35 212.95 3.04 Reduce complexity. Split out functionality
gaphor/codegen/profile_coder.py write_properties 36 202.66 3.08 Reduce complexity. Split out functionality
gaphor/storage/storage.py save_element 28 267.82 3.10 Split out functionality
gaphor/plugins/diagramexport/gaphorconvert.py main 25 246.70 3.47 Split out functionality

Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance related PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants