Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/191882

Change subject: Remove yamllint
......................................................................

Remove yamllint

To lint yaml we are using python-yaml which has a few problems:

- it can load an arbitrary python object which is rather unsafe
- does not support multiple documents (T86194)
- it is only for python, not for other languages implementations we use
  such as the javascript one.

Get rid of our lame YAML linter, in favor of having developers write a
test to validate their files.

Change-Id: I8e61ededf50c6ce691ffcdda35cfe6b7d09f101f
---
D tools/yamllint.py
1 file changed, 0 insertions(+), 61 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins 
refs/changes/82/191882/1

diff --git a/tools/yamllint.py b/tools/yamllint.py
deleted file mode 100755
index ffba50f..0000000
--- a/tools/yamllint.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python
-#
-#
-# Copyright 2013, Antoine Musso
-# Copyright 2013, Wikimedia Foundation Inc.
-#
-# Released under GPLv2
-#
-# Disable pylint checks about globals requiring upercase first:
-# pylint: disable=C0103
-
-"""A  basic script that recursively find YAML files under one or more
-   directories and attempt to parse them using PyYAML.
-"""
-import argparse
-import logging
-import os
-import sys
-import yaml
-
-parser = argparse.ArgumentParser(description=__doc__)
-parser.add_argument('-v', '-verbose', dest='verbose', action='count',
-                    help='increase verbosity')
-parser.add_argument('dirs', nargs='+',
-                    help='paths to look for YAML files')
-args = parser.parse_args()
-
-# Set up verbosity
-if args.verbose == 1:
-    log_level = logging.INFO
-elif args.verbose == 2:
-    log_level = logging.DEBUG
-else:
-    log_level = logging.WARNING
-
-logging.basicConfig(level=log_level, format='%(levelname)s %(message)s')
-
-errors = 0
-files = 0
-for path in args.dirs:
-    for root, dirnames, filenames in os.walk(path):
-        for a_file in filenames:
-            if a_file.lower().endswith(('.yaml', '.yml')):
-                full_path = os.path.join(root, a_file)
-                logging.debug("Invoking yaml.safe_load_all on %s", full_path)
-                try:
-                    files += 1
-                    yaml.safe_load(file(full_path, 'r'))
-                    logging.info('[PASS] ' + full_path)
-                except Exception, exc:
-                    logging.error("Invalid file %s raised: %s",
-                                  full_path, exc, exc_info=False)
-                    errors += 1
-
-if errors == 0:
-    print "Good, all %s files passed!" % files
-    sys.exit(0)
-else:
-    logging.error("Oh no, found %s files with errors out of %s files.",
-                  errors, files)
-    sys.exit(1)

-- 
To view, visit https://gerrit.wikimedia.org/r/191882
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e61ededf50c6ce691ffcdda35cfe6b7d09f101f
Gerrit-PatchSet: 1
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to