Re: [Freeipa-devel] [PATCH 022] make-lint Python 3 porting mode

2015-08-03 Thread Christian Heimes
On 2015-08-03 11:30, Jan Cholasta wrote:
> Hi,
> 
> Dne 3.8.2015 v 11:22 Christian Heimes napsal(a):
>> Python 3 porting mode for make-lint
>>
>> http://docs.pylint.org/features.html#general-options
> 
> I would rather wait until all the modernization patches are pulled in
> and then make the porting mode enabled by default. If it's optional, no
> one will use it.

In porting mode the normal checkers aren't executed. In order to enable
the porting mode by default, make-lint has to run two passes: one linter
instance with and one linter instance without the porting mode.




signature.asc
Description: OpenPGP digital signature
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [PATCH 022] make-lint Python 3 porting mode

2015-08-03 Thread Jan Cholasta

Hi,

Dne 3.8.2015 v 11:22 Christian Heimes napsal(a):

Python 3 porting mode for make-lint

http://docs.pylint.org/features.html#general-options


I would rather wait until all the modernization patches are pulled in 
and then make the porting mode enabled by default. If it's optional, no 
one will use it.


Honza

--
Jan Cholasta

--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code


[Freeipa-devel] [PATCH 022] make-lint Python 3 porting mode

2015-08-03 Thread Christian Heimes
Python 3 porting mode for make-lint

http://docs.pylint.org/features.html#general-options
From eb0565a16934a85df5075a6389dc49239e08f699 Mon Sep 17 00:00:00 2001
From: Christian Heimes 
Date: Mon, 3 Aug 2015 11:18:03 +0200
Subject: [PATCH] make-lint Python 3 porting mode

pylint can check code for Python 3 portability. The new option --py3k
enables the Python 3 porting mode of pylint in make-lint.
---
 make-lint | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/make-lint b/make-lint
index 0447985303f485a014fecf7d17d0b1c7eb6137bd..04d7f3644bef7fccba1ce37b9d92e2e1405ffd08 100755
--- a/make-lint
+++ b/make-lint
@@ -220,6 +220,8 @@ def main():
 dest='fail', default=True, action='store_false')
 optparser.add_option('--enable-noerror', help='enable warnings and other non-error messages',
 dest='errors_only', default=True, action='store_false')
+optparser.add_option('--py3k', help='Python 3 porting mode',
+dest='py3k', default=False, action='store_true')
 
 options, args = optparser.parse_args()
 cwd = os.getcwd()
@@ -246,7 +248,10 @@ def main():
 '{path}:{line}: [{msg_id}({symbol}), {obj}] {msg})')
 linter.set_option('reports', False)
 linter.set_option('persistent', False)
-linter.set_option('disable', 'python3')
+if options.py3k:
+linter.python3_porting_mode()
+else:
+linter.set_option('disable', 'python3')
 
 linter.check(files)
 
-- 
2.4.3



signature.asc
Description: OpenPGP digital signature
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code