From 7e0fa4787f112d6ca0860b22f9febfab73fa99ac Mon Sep 17 00:00:00 2001 From: Yousef Saeed Date: Sat, 22 Jul 2023 18:40:23 +0300 Subject: [PATCH 1/3] Added support for wildcards --- w3c_validator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/w3c_validator.py b/w3c_validator.py index ec7ec71..a5a8b9a 100755 --- a/w3c_validator.py +++ b/w3c_validator.py @@ -19,6 +19,7 @@ ``` ./w3c_validator.py index.html header.html styles/common.css +./w3c_validator.py *.html styles/*.css ``` All errors are printed in `STDERR` @@ -29,6 +30,7 @@ import sys import requests import os +import glob def __print_stdout(msg): @@ -113,8 +115,10 @@ def __files_loop(): """Loop that analyses for each file from input arguments """ nb_errors = 0 - for file_path in sys.argv[1:]: - nb_errors += __analyse(file_path) + for pattern in sys.argv[1:]: + files = glob.glob(pattern) + for file_path in files: + nb_errors += __analyse(file_path) return nb_errors From 047cd419451bfe1d586f57337e0d2a0605f7a75b Mon Sep 17 00:00:00 2001 From: Yousef Saeed Date: Sat, 22 Jul 2023 19:06:29 +0300 Subject: [PATCH 2/3] Add examples for validating files using wildcards --- README.md | 4 ++++ w3c_validator.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index be15774..5b22b69 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ Multiple files: ./w3c_validator.py index.html article.html css/styles.css ``` +```sh +./w3c_validator.py *.html css/*.css +``` + All errors are printed in `STDERR`; Exit status = # of errors (0 on success) ## Troubleshooting diff --git a/w3c_validator.py b/w3c_validator.py index a5a8b9a..a7b2643 100755 --- a/w3c_validator.py +++ b/w3c_validator.py @@ -19,6 +19,9 @@ ``` ./w3c_validator.py index.html header.html styles/common.css +``` + +``` ./w3c_validator.py *.html styles/*.css ``` From 668d4fe4abd9cb36eb2e7fa837204133d1be1377 Mon Sep 17 00:00:00 2001 From: Yousef Saeed Date: Tue, 18 Jun 2024 01:41:34 +0300 Subject: [PATCH 3/3] Update description --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5b22b69..92d2e30 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # W3C validator for Holberton School -For HTML, CSS and SVG files +A script that checks the conformance of HTML, CSS, and SVG files against W3C standards. + +This fork enhances the original W3C-Validator by adding wildcard support, allowing you to validate multiple files at once. Based on 1 API: - [Markup Validator Web Service API](https://validator.w3.org/docs/api.html) @@ -11,7 +13,7 @@ Based on 1 API: ## Quickstart 1. Clone this repo ```sh -git clone https://github.com/holbertonschool/W3C-Validator.git +git clone https://github.com/uosyph/W3C-Validator.git ``` 2. Run the validator command from within