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

AStyle: Fix astyle indentation #7007

Merged
merged 2 commits into from Jun 1, 2018

Commits on May 24, 2018

  1. AStyle: don't indent cases

    This was a bug in our configuration. Earlier versions of our style did not
    specify this option. We found out for some code in our codebase that it was
    changed because of the setting.
    
    An example:
    
    ```
    case: {
        // code here
    }
    
    //would be changed to
    
    case: {
        // code here
       }
    ```
    
    The first one is correct and do not need to be indented (it's enough switch is
    indented).
    0xc0170 committed May 24, 2018
    Copy the full SHA
    1059c26 View commit details
    Browse the repository at this point in the history
  2. AStyle: fix indentation for longer lines

    Long lines like this would have parameters misaligned but shorter lines would be OK.
    
    ```
     void LoRaMac::check_frame_size(uint16_t size)
     {
         uint8_t value = _lora_phy.get_max_payload(_mcps_indication.rx_datarate,
    -                                              _params.is_repeater_supported);
    +                    _params.is_repeater_supported);
    +
    +    _lora_phy.a(_mcps_indication.b,
    +                b.is_repeater_supported);
    ```
    
    With this option (applied to the code above), we get
    
    ```
    @@ -319,6 +319,9 @@ void LoRaMac::check_frame_size(uint16_t size)
         uint8_t value = _lora_phy.get_max_payload(_mcps_indication.rx_datarate,
                                                   _params.is_repeater_supported);
    
    +    _lora_phy.a(_mcps_indication.b,
    +                b.is_repeater_supported);
    ```
    
    Both are aligned the same. However there is a limit of astyle - 120 columns for this.
    We do in most cases lines from 80 to 120 as suggested in our code lines thus this should
    be good.
    0xc0170 committed May 24, 2018
    Copy the full SHA
    f835c89 View commit details
    Browse the repository at this point in the history