From a8b463311ac8eff2485b8d89dca7c7faf88e957d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20De=20Freitas?= <37962411+JoseDeFreitas@users.noreply.github.com> Date: Sat, 6 Feb 2021 14:47:14 -0500 Subject: [PATCH] Add files via upload --- linter/lint.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 linter/lint.py diff --git a/linter/lint.py b/linter/lint.py new file mode 100644 index 0000000..7b37424 --- /dev/null +++ b/linter/lint.py @@ -0,0 +1,28 @@ +from rules import (content_about, featured_playlists, youtubers_names) + +file_readme = './../readme.md' +with open(file_readme, 'r') as read_readme: + content_readme = read_readme.readlines() + +def main(): + """ + Main function. Used specifically to call print results + by calling functions into rules/. + """ + if len(youtubers_names.youtubers_name_errors_nums) == 0: + print("Every YouTubers names are good.", "\n") + else: + print("'YouTubers name' errors:\n", '\n'.join(["Error at line {}: there should be a trailing '\\'.".format(i) for i in youtubers_names.youtubers_name_errors_nums]), "\n") + + if len(content_about.content_about_errors_nums) == 0: + print("Every 'Content about' sections are good.", "\n") + else: + print("'Content about' errors:\n", '\n'.join(["Error at line {}: there should be a trailing '\\'.".format(i) for i in content_about.content_about_errors_nums]), "\n") + + if len(featured_playlists.featured_playlists_errors_nums) == 0: + print("Every 'Featured playlists' sections are good.", "\n") + else: + print("'Featured playlists' errors:\n", '\n'.join(["Error at line {}: there should be a trailing '\\'.".format(i) for i in featured_playlists.featured_playlists_errors_nums]), "\n") + +if __name__ == '__main__': + main()