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

assign variables breaks into new lines (question) #83

Closed
mau2099 opened this issue Feb 11, 2022 · 4 comments
Closed

assign variables breaks into new lines (question) #83

mau2099 opened this issue Feb 11, 2022 · 4 comments
Assignees

Comments

@mau2099
Copy link

mau2099 commented Feb 11, 2022

Hi! I was wondering how can I get a better format:

I have this messed piece of code (before format)

Messed pieced of code

{% assign currentInsurableItems = policy.detail.insurableItems | where:
'versionInfo.versionNumber', policy.versionInfo.versionNumber | where:
'itemType', 'vehicle' %} {% if currentInsurableItems %}
<div>
  <table class="esignAutoAppTable" data-testid="coverages-table">
    <tbody>
      {% for currentItem in currentInsurableItems %} {% assign usState =
      policy.detail.usState %} {% assign umLabel = 'UM' %} {% assign biLimit =
      nil %} {% assign pdLimit = nil %} {% assign umpdLimit = nil %} {% assign
      umpdValue = nil %} {% assign collLimit = nil %} {% assign compLimit = nil
      %} {% assign mpLimit = nil %} {% assign raLimit = 'Not Included' %} {%
      assign atLimit = nil %} {% assign uimpdLimit = nil %} {% assign umLimit =
      nil %} {% assign uiumLimit = nil %} {% endfor %}
    </tbody>
  </table>
</div>
{% endif %}

current outcomes (formatted)

{% assign currentInsurableItems = policy.detail.insurableItems | where:
'versionInfo.versionNumber', policy.versionInfo.versionNumber | where:
'itemType', 'vehicle' %}
{% if currentInsurableItems %}
  <div>
    <table class="esignAutoAppTable" data-testid="coverages-table">
      <tbody>
        {% for currentItem in currentInsurableItems %}
          {% assign usState =
      policy.detail.usState %}
          {% assign umLabel = 'UM' %}
          {% assign biLimit =
      nil %}
          {% assign pdLimit = nil %}
          {% assign umpdLimit = nil %}
          {% assign
      umpdValue = nil %}
          {% assign collLimit = nil %}
          {% assign compLimit = nil
      %}
          {% assign mpLimit = nil %}
          {% assign raLimit = 'Not Included' %}
          {%
      assign atLimit = nil %}
          {% assign uimpdLimit = nil %}
          {% assign umLimit =
      nil %}
          {% assign uiumLimit = nil %}
        {% endfor %}
      </tbody>
    </table>
  </div>
{% endif %}

expected outcomes (desired)

(all assign statements in one line)

{% assign currentInsurableItems = policy.detail.insurableItems | where:
'versionInfo.versionNumber', policy.versionInfo.versionNumber | where:
'itemType', 'vehicle' %}
{% if currentInsurableItems %}
  <div>
    <table class="esignAutoAppTable" data-testid="coverages-table">
      <tbody>
        {% for currentItem in currentInsurableItems %}
          {% assign usState = policy.detail.usState %}
          {% assign umLabel = 'UM' %}
          {% assign biLimit =nil %}
          {% assign pdLimit = nil %}
          {% assign umpdLimit = nil %}
          {% assign umpdValue = nil %}
          {% assign collLimit = nil %}
          {% assign compLimit = nil %}
          {% assign mpLimit = nil %}
          {% assign raLimit = 'Not Included' %}
          {% assign atLimit = nil %}
          {% assign uimpdLimit = nil %}
          {% assign umLimit = nil %}
          {% assign uiumLimit = nil %}
        {% endfor %}
      </tbody>
    </table>
  </div>
{% endif %}

how could I get this kind of formatting?

@mau2099 mau2099 changed the title assign variables breaks into new lines assign variables breaks into new lines (question) Feb 11, 2022
@panoply
Copy link
Owner

panoply commented Feb 11, 2022

Hey @mau2099 this is likely a defect. You can adjust it manually after initial format.

@panoply panoply self-assigned this Feb 11, 2022
@panoply panoply added this to the Liquify milestone Feb 11, 2022
@mau2099
Copy link
Author

mau2099 commented Feb 11, 2022

Hey @mau2099 this is likely a defect. You can adjust it manually after initial format.

thanks for your answer!
do you mean it's a defect in the original prettydiff tool? Or am I doing something wrong in the code?
do you have an expected date to release your tool Liquify?

Thank you a lot!

@panoply
Copy link
Owner

panoply commented Feb 11, 2022

do you mean it's a defect in the original prettydiff tool? Or am I doing something wrong in the code?

So likely an issue with PrettyDiff the current version of this extension is using or something internally happening when the code is being formatted, I would need to run tests to see where it actually happening, nothing wrong with your code though.

In Liquify, the formatting logic was completely overhauled and it uses a hard-froked variation of PrettyDiff which addresses all these issues. That project is called Prettify so I will likely upstream the defect in that project.

do you have an expected date to release your tool Liquify?

In the past I have failed to come through on release dates (like, I am really bad at keeping to deadlines with this tool) so I try to avoid giving them because I am the only developer really working on it atm. I am aiming towards a summer release as per liquify.dev. I just need to find the time, I apologize for delays or headaches the current version is giving you.

@panoply panoply removed this from the Liquify milestone Sep 25, 2022
@panoply
Copy link
Owner

panoply commented Sep 28, 2022

🚢 Shipped v3.0.0

@panoply panoply closed this as completed Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants