[apparmor] [patch 16/18] utils: address pep8 complaints

Christian Boltz apparmor at cboltz.de
Fri Jan 17 00:29:31 UTC 2014


Hello,

Am Donnerstag, 16. Januar 2014 schrieb Steve Beattie:
> This patch eliminates the complaints from running:
> 
>   pep8 --ignore=E501 aa-easyprof vim/
> 
> (E501 is 'line too long', which I'm not too chuffed about.
> )
> Mostly, it's a lot of whitespace touchups, with a few conversions from
> '==' to 'is'.
> 
> Signed-off-by: Steve Beattie <steve at nxnw.org>
> ---
>  utils/aa-easyprof                |    3
>  utils/vim/create-apparmor.vim.py |  133
> +++++++++++++++++++-------------------- 2 files changed, 68
> insertions(+), 68 deletions(-)
> 


> Index: b/utils/vim/create-apparmor.vim.py
> ===================================================================
> --- a/utils/vim/create-apparmor.vim.py
> +++ b/utils/vim/create-apparmor.vim.py
> @@ -73,28 +74,28 @@ for af_pair in af_pairs:
...
>  aa_regex_map = {
>      'FILENAME':         filename,
> -    'FILE':            
> r'\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+)?' + filename +
> r'\s+', # Start of a file rule +    'FILE':            
> r'\v^\s*(audit\s+)?(deny\s+|allow\s+)?(owner\s+)?' + filename +
> r'\s+',  # Start of a file rule # (whitespace_+_, owner etc. flag_?_,
> filename pattern, whitespace_+_) -    'DENYFILE':        
> r'\v^\s*(audit\s+)?deny\s+(owner\s+)?' + filename + r'\s+', # deny,
> otherwise like FILE +    'DENYFILE':        
> r'\v^\s*(audit\s+)?deny\s+(owner\s+)?' + filename + r'\s+',  # deny,
> otherwise like FILE 'auditdenyowner':  
> r'(audit\s+)?(deny\s+|allow\s+)?(owner\s+)?', -   
> 'audit_DENY_owner': r'(audit\s+)?deny\s+(owner\s+)?', # must include
> "deny", otherwise like auditdenyowner +    'audit_DENY_owner':
> r'(audit\s+)?deny\s+(owner\s+)?',  # must include "deny", otherwise
> like auditdenyowner 'auditdeny':       
> r'(audit\s+)?(deny\s+|allow\s+)?',
> -    'EOL':              r'\s*,(\s*$|(\s*#.*$)\@=)', # End of a line
> (whitespace_?_, comma, whitespace_?_ comment.*) +    'EOL':          
>    r'\s*,(\s*$|(\s*#.*$)\@=)',  # End of a line (whitespace_?_,
> comma, whitespace_?_ comment.*) 'TRANSITION':      
> r'(\s+-\>\s+\S+)?',

Sorry for the terrible quoting, anyway:
Does it really make sense to have two spaces in front of # ?

> +#syn match  sdEntryM /@@DENYFILE@@(r|mk|x)+@@EOL@@/ 
> contains=sdGlob,sdComment 
> nextgroup=@sdEntry,sdComment,sdError,sdInclude
> -#syn match  sdEntryM /@@DENYFILE@@(r|m|k|x)+@@EOL@@/
> contains=sdGlob,sdComment 
> nextgroup=@sdEntry,sdComment,sdError,sdInclude

NAK - you broke the regex here (first search for the difference 
yourself, then have a look at [1] ;-)
(and yes, I'd like to have this un-broken even if it's only a comment)

With that fixed, 
Acked-by: Christian Boltz <apparmor at cboltz.de>


Regards,

Christian Boltz

[1] It probably becomes more obvious with the lines shortened:

> +#syn match  sdEntryM /@@DENYFILE@@(r|mk|x)+@@EOL@@/
> -#syn match  sdEntryM /@@DENYFILE@@(r|m|k|x)+@@EOL@@/ 
                                        ^^^
-- 
> ...womit die Geschichte wieder von vorn losgeht...
Jaha, aber nun ist das eine vollkommen andere Situation: Jetzt hast Du
nämlich eine von Suse generierte kdmrc für ein von Suse geliefertes KDE,
und KDE ist eine vom Installationssupport abgedeckte Komponente.
Also ist das ein meldefähiger und supportberechtigter Bug! :-)
[> Gerald Martin und Kristian Köhntopp in suse-linux]




More information about the AppArmor mailing list