sunchao / parquet-rs

Apache Parquet implementation in Rust
Apache License 2.0
149 stars 20 forks source link

Fix line width in files #43

Closed sadikovi closed 6 years ago

sadikovi commented 6 years ago

This PR is a minor update, fixes remaining line width in files (<= 90). I assume that this rule does not apply to imports (only line 23 in printer.rs).

Also updated code to use get_test_column_desc_ptr() instead of custom code in test_get_decoder.

sadikovi commented 6 years ago

This is super minor lazy patch of line widths. I thought I might as well do it - does not take long. @sunchao Could you review, please?

I am not sure if there is a way to find out such files with cargo or IDE - I just used this :):

import os

def check_line_width(f, lines):
    for i, line in enumerate(lines):
        if len(line) > 90:
            print "%s: L%s line width %s > 90" % (f, i+1, len(line))

def check_repo(path, ext=".rs"):
    for root, dirs, files in os.walk(path):
        for f in files:
            if f.endswith(ext) and f != "parquet.rs":
                with open(os.path.join(root, f), 'r') as h:
                    check_line_width(f, [line.strip('\n') for line in h])

check_repo("/path/to/parquet-rs")
coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.006%) to 92.259% when pulling 34325d03a89d64cd1f60a0cd4329a018645b33d6 on sadikovi:fix-line-width into 4e34ab3db8739bb7091f9a24e7e8579e696ae0a1 on sunchao:master.

sunchao commented 6 years ago

@sadikovi Thanks! Just accepted it. I think rustfmt might help for this but I never look into details. Will take a look in future.

sadikovi commented 6 years ago

Thanks! I never used rustfmt - sounds like something we could use.