Commit c4f4badb authored by Asitha Senanayake's avatar Asitha Senanayake
Browse files

style: lint files using flake8

parent 80b5838c
Loading
Loading
Loading
Loading

.flake8

0 → 100644
+2 −0
Original line number Diff line number Diff line
[flake8]
max-line-length=150
+0 −2
Original line number Diff line number Diff line
@@ -716,7 +716,6 @@ def check_file(filepath_or_buffer, standard_AGS4_dictionary=None, rename_duplica
    """

    from python_ags4 import check
    import traceback

    ags_errors = {}

@@ -788,7 +787,6 @@ def check_file(filepath_or_buffer, standard_AGS4_dictionary=None, rename_duplica
            ags_errors = check.rule_19a(line, i, group=group, ags_errors=ags_errors)
            ags_errors = check.rule_19b_1(line, i, group=group, ags_errors=ags_errors)


        # Add additional information about how Rule 1 is implemented if infringements are detected
        if 'AGS Format Rule 1' in ags_errors:
            msg = "AGS4 Rule 1 is interpreted as allowing both standard ASCII characters (Unicode code points 0-127) "\
+10 −9
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ logger = logging.getLogger('python_ags4')
logger.setLevel(logging.DEBUG)
logger.addHandler(stream_handler)


@click.group()
def main():
    '''A tool to read, write, and check AGS4 files.
@@ -281,7 +282,7 @@ def sort(input_file, output_file, sorting_strategy, log_messages):
            console.print(f'[green]Opening file... [bold]{input_file}[/bold][/green]')
            tables, headings = AGS4.AGS4_to_dataframe(input_file)

            console.print(f'[green]Sorting tables... [/green]')
            console.print('[green]Sorting tables... [/green]')
            print('')
            sorted_tables = AGS4.sort_groups(tables, sorting_strategy)

+1 −1
Original line number Diff line number Diff line
@@ -737,7 +737,7 @@ def test_file_with_BOM():

    msg1 = 'This file seems to be encoded with a byte-order-mark (BOM). It is highly recommended that the '\
           'file be saved without BOM encoding to avoid issues with other software.'
    msg2 = f"Has Non-ASCII character(s) (assuming that file encoding is 'utf-8') and/or a byte-order-mark (BOM)."
    msg2 = "Has Non-ASCII character(s) (assuming that file encoding is 'utf-8') and/or a byte-order-mark (BOM)."

    assert msg1 in error_list['General'][1]['desc']
    assert msg2 in error_list['AGS Format Rule 1'][0]['desc']