Simply avoid validating AMP

This commit is contained in:
Alexey Milovidov 2021-05-21 10:36:45 +03:00
parent 24f1856d5a
commit cec9d48edc
2 changed files with 0 additions and 14 deletions

View File

@ -62,7 +62,6 @@ def build_amp(lang, args, cfg):
for root, _, filenames in os.walk(site_temp):
if 'index.html' in filenames:
paths.append(prepare_amp_html(lang, args, root, site_temp, main_site_dir))
test.test_amp(paths, lang)
logging.info(f'Finished building AMP version for {lang}')

View File

@ -7,19 +7,6 @@ import bs4
import subprocess
def test_amp(paths, lang):
# Get latest amp validator version # TODO This makes "leftpad" attack possible, remove it.
subprocess.check_call('command -v sudo && sudo npm install --global amphtml-validator || npm install --global amphtml-validator', shell=True)
for path in paths:
command = f'amphtml-validator {path}'
try:
subprocess.check_output(command, shell=True).decode('utf-8')
except subprocess.CalledProcessError:
logging.error(f'Invalid AMP for {lang}, {path}')
raise
def test_template(template_path):
if template_path.endswith('amp.html'):
# Inline CSS/JS is ok for AMP pages