COMCIFS / comcifs.github.io

Draft COMCIFS documents
1 stars 4 forks source link

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

Open vaitkus opened 1 year ago

vaitkus commented 1 year ago

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 commented 1 year ago

Yes, sounds good.