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

ddlm_dictionary_style_guide.md: exclude _method.expression from some indendation rules #20

Open
vaitkus opened this issue Jun 16, 2023 · 1 comment

Comments

@vaitkus
Copy link
Collaborator

vaitkus commented Jun 16, 2023

The _method.expression attribute contains dREL code which would be best subjected to its own set of style and formatting rules. I do not suggest that we define them right now, but I would like to see this attribute excluded from rule 3.2.10 which states:

If there are two values in a packet and the second value would appear on a separate line, loop step in rule 3.2.8.iv above is replaced by loop align + text indent. If one of the values is semicolon-delimited and the other is not, the semicolon-delimited value has an internal indent of loop align - 1.

That is, I suggest that in cases like:

    loop_
      _method.purpose
      _method.expression
         Definition
;
         If (_diffrn_radiation.probe == "neutron")
             _units.code = "femtometres"
         Else If (_diffrn_radiation.probe == "electron")
             _units.code =  "volts"
         Else
             _units.code =  "electrons"
;
         Evaluation
;
         _refln.A_calc =  Real ( _refln.F_complex )

the minimum indentation in _method.expression values would be changed from 9 to 4 (the regular minimal indentation in non-looped multi-line fields), like this:

    loop_
      _method.purpose
      _method.expression
         Definition
;
    If (_diffrn_radiation.probe == "neutron")
        _units.code = "femtometres"
    Else If (_diffrn_radiation.probe == "electron")
        _units.code =  "volts"
    Else
        _units.code =  "electrons"
;
         Evaluation
;
    _refln.A_calc =  Real ( _refln.F_complex )
;

Does this seem ok?

@jamesrhester
Copy link
Contributor

Yes, sounds good.

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