diff --git a/LICENSE b/LICENSE
index 94a9ed0..f288702 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
-.
+.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
-.
+.
diff --git a/yamllint/linter.py b/yamllint/linter.py
index 3984970..58dbba4 100644
--- a/yamllint/linter.py
+++ b/yamllint/linter.py
@@ -29,6 +29,9 @@ PROBLEM_LEVELS = {
'error': 2,
}
+DISABLE_RULE_PATTERN = re.compile(r'^# yamllint disable( rule:\S+)*\s*$')
+ENABLE_RULE_PATTERN = re.compile(r'^# yamllint enable( rule:\S+)*\s*$')
+
class LintProblem(object):
"""Represents a linting problem found by yamllint."""
@@ -82,7 +85,7 @@ def get_cosmetic_problems(buffer, conf, filepath):
def process_comment(self, comment):
comment = str(comment)
- if re.match(r'^# yamllint disable( rule:\S+)*\s*$', comment):
+ if DISABLE_RULE_PATTERN.match(comment):
items = comment[18:].rstrip().split(' ')
rules = [item[5:] for item in items][1:]
if len(rules) == 0:
@@ -92,7 +95,7 @@ def get_cosmetic_problems(buffer, conf, filepath):
if id in self.all_rules:
self.rules.add(id)
- elif re.match(r'^# yamllint enable( rule:\S+)*\s*$', comment):
+ elif ENABLE_RULE_PATTERN.match(comment):
items = comment[17:].rstrip().split(' ')
rules = [item[5:] for item in items][1:]
if len(rules) == 0:
diff --git a/yamllint/rules/octal_values.py b/yamllint/rules/octal_values.py
index d531a89..7796e50 100644
--- a/yamllint/rules/octal_values.py
+++ b/yamllint/rules/octal_values.py
@@ -96,7 +96,7 @@ def check(conf, token, prev, next, nextnext, context):
if not token.style:
val = token.value
if (val.isdigit() and len(val) > 1 and val[0] == '0' and
- IS_OCTAL_NUMBER_PATTERN.match(val[1:]) is not None):
+ IS_OCTAL_NUMBER_PATTERN.match(val[1:])):
yield LintProblem(
token.start_mark.line + 1, token.end_mark.column + 1,
'forbidden implicit octal value "%s"' %
@@ -107,7 +107,7 @@ def check(conf, token, prev, next, nextnext, context):
if not token.style:
val = token.value
if (len(val) > 2 and val[:2] == '0o' and
- IS_OCTAL_NUMBER_PATTERN.match(val[2:]) is not None):
+ IS_OCTAL_NUMBER_PATTERN.match(val[2:])):
yield LintProblem(
token.start_mark.line + 1, token.end_mark.column + 1,
'forbidden explicit octal value "%s"' %