Midnighter / structurizr-python

A Python 3 port of Simon Brown's Structurizr diagrams-as-code architecture description tool.
https://structurizr.com/
Apache License 2.0
65 stars 16 forks source link

refactor: combine all views in ViewSet into a single dictionary #83

Closed yt-ms closed 3 years ago

yt-ms commented 3 years ago

This should not have any external impact, but refactors ViewSet to combine all the views into a single dictionary so we can key it by the view key. This simplifies a number of methods which had very repetitive logic per view type.


THIS SOFTWARE IS CONTRIBUTED SUBJECT TO THE TERMS OF THE Apache License v.2.0. YOU MAY OBTAIN A COPY OF THE LICENSE AT https://www.apache.org/licenses/LICENSE-2.0.

THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.

codecov-commenter commented 3 years ago

Codecov Report

Merging #83 (63671bd) into devel (634ca23) will increase coverage by 1.32%. The diff coverage is 95.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel      #83      +/-   ##
==========================================
+ Coverage   94.01%   95.33%   +1.32%     
==========================================
  Files          76       76              
  Lines        2405     2380      -25     
  Branches      248      226      -22     
==========================================
+ Hits         2261     2269       +8     
+ Misses        116       89      -27     
+ Partials       28       22       -6     
Impacted Files Coverage Δ
src/structurizr/view/view_set.py 91.86% <95.45%> (+17.24%) :arrow_up:
src/structurizr/api/structurizr_client_settings.py 88.23% <0.00%> (-8.83%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 634ca23...63671bd. Read the comment docs.