sky-uk / bslint

A linter for the BrightScript language.
BSD 3-Clause "New" or "Revised" License
24 stars 9 forks source link

File encoding not checked. #158

Open JackIngleton opened 7 years ago

JackIngleton commented 7 years ago

Although the 'check file encoding' command has been tested directly, it is not actually implemented when running bslint from the command line. The command is executed in the file reader method in the interface handler:

@staticmethod
    def file_reader(file_to_lex):
        with open(file_to_lex, "r+") as file:
            str_to_lex = file.read()
        return {"invalid_encoding": commands.check_file_encoding(file_to_lex), "file_content": str_to_lex}

However, the 'invalid_encoding' field is never actually used:

    def lint_file(self, filepath):
     ...
            file_content = self.file_reader(filename)['file_content']
     ...