public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/uri/
Date: Fri, 30 Mar 2018 05:20:47 +0000 (UTC)	[thread overview]
Message-ID: <1522381879.f7cb68a8d05fa555cc52ac7117ad50456060129b.zmedico@gentoo> (raw)
Message-ID: <20180330052047.XLbsHdaDSGFFi1WYrkGCewRyRFCm93g2GRsszMguzDY@z> (raw)

commit:     f7cb68a8d05fa555cc52ac7117ad50456060129b
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:05:03 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 03:51:19 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f7cb68a8

repoman: New linechecks module, uri

 .../pym/repoman/modules/linechecks/uri/__init__.py | 21 +++++++++++++++
 repoman/pym/repoman/modules/linechecks/uri/uri.py  | 30 ++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/uri/__init__.py b/repoman/pym/repoman/modules/linechecks/uri/__init__.py
new file mode 100644
index 000000000..a7731e3cc
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/uri/__init__.py
@@ -0,0 +1,21 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Uri plug-in module for repoman LineChecks.
+Performs HOMEPAGE variable checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'do',
+	'description': doc,
+	'provides':{
+		'httpsuri-check': {
+			'name': "httpsuri",
+			'sourcefile': "uri",
+			'class': "UriUseHttps",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/uri/uri.py b/repoman/pym/repoman/modules/linechecks/uri/uri.py
new file mode 100644
index 000000000..1a0afe682
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/uri/uri.py
@@ -0,0 +1,30 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class UriUseHttps(LineCheck):
+	"""Check that we use https:// for known good sites."""
+	repoman_check_name = 'uri.https'
+	_SITES = (
+		'([-._a-zA-Z0-9]*\.)?apache\.org',
+		'((alioth|packages(\.qa)?|people|www)\.)?debian\.org',
+		# Most FDO sites support https, but not all (like tango).
+		# List the most common ones here for now.
+		'((anongit|bugs|cgit|dri|patchwork|people|specifications|www|xcb|xorg)\.)?freedesktop\.org',
+		'((bugs|dev|wiki|www)\.)?gentoo\.org',
+		'((wiki)\.)?github\.(io|com)',
+		'savannah\.(non)?gnu\.org',
+		'((gcc|www)\.)?gnu\.org',
+		'curl\.haxx\.se',
+		'((bugzilla|git|mirrors|patchwork|planet|www(\.wiki)?)\.)?kernel\.org',
+		'((bugs|wiki|www)\.)?linuxfoundation\.org',
+		'((docs|pypi|www)\.)?python\.org',
+		'(sf|sourceforge)\.net',
+		'(www\.)?(enlightenment|sourceware|x)\.org',
+	)
+	# Try to anchor the end of the URL so we don't get false positives
+	# with http://github.com.foo.bar.com/.  Unlikely, but possible.
+	re = re.compile(r'.*\bhttp://(%s)(\s|["\'/]|$)' % r'|'.join(_SITES))
+	error = 'URI_HTTPS'


             reply	other threads:[~2018-03-30  5:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30  4:23 Zac Medico [this message]
2018-03-30  5:20 ` [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/uri/ Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522381879.f7cb68a8d05fa555cc52ac7117ad50456060129b.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox