mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Remove '.'s from extensions in lister.py interface and lint-all.
In lint-all, change occurences of '.py', '.js', ... to 'py', 'js', ....
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							ad4c20a3e6
						
					
				
				
					commit
					81fdeae0ea
				
			@@ -45,7 +45,7 @@ puppet/apt/.forge-release
 | 
				
			|||||||
""".split()
 | 
					""".split()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
by_lang = lister.list_files(args, modified_only=options.modified, use_shebang=True,
 | 
					by_lang = lister.list_files(args, modified_only=options.modified, use_shebang=True,
 | 
				
			||||||
    ftypes=['.py', '.sh', '.js', '.pp'], group_by_ftype=True, exclude=exclude)
 | 
					    ftypes=['py', 'sh', 'js', 'pp'], group_by_ftype=True, exclude=exclude)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Invoke the appropriate lint checker for each language,
 | 
					# Invoke the appropriate lint checker for each language,
 | 
				
			||||||
# and also check files for extra whitespace.
 | 
					# and also check files for extra whitespace.
 | 
				
			||||||
@@ -57,10 +57,10 @@ logger = logging.getLogger()
 | 
				
			|||||||
logger.setLevel(logging.WARNING)
 | 
					logger.setLevel(logging.WARNING)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def check_pyflakes():
 | 
					def check_pyflakes():
 | 
				
			||||||
    if not by_lang['.py']:
 | 
					    if not by_lang['py']:
 | 
				
			||||||
        return False
 | 
					        return False
 | 
				
			||||||
    failed = False
 | 
					    failed = False
 | 
				
			||||||
    pyflakes = subprocess.Popen(['pyflakes'] + by_lang['.py'],
 | 
					    pyflakes = subprocess.Popen(['pyflakes'] + by_lang['py'],
 | 
				
			||||||
        stdout = subprocess.PIPE,
 | 
					        stdout = subprocess.PIPE,
 | 
				
			||||||
        stderr = subprocess.PIPE)
 | 
					        stderr = subprocess.PIPE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -157,15 +157,15 @@ bash_rules = [
 | 
				
			|||||||
def check_custom_checks():
 | 
					def check_custom_checks():
 | 
				
			||||||
    failed = False
 | 
					    failed = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for fn in by_lang['.py']:
 | 
					    for fn in by_lang['py']:
 | 
				
			||||||
        if custom_check_file(fn, python_rules, skip_rules=python_line_skip_rules):
 | 
					        if custom_check_file(fn, python_rules, skip_rules=python_line_skip_rules):
 | 
				
			||||||
            failed = True
 | 
					            failed = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for fn in by_lang['.js']:
 | 
					    for fn in by_lang['js']:
 | 
				
			||||||
        if custom_check_file(fn, js_rules):
 | 
					        if custom_check_file(fn, js_rules):
 | 
				
			||||||
            failed = True
 | 
					            failed = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for fn in by_lang['.sh']:
 | 
					    for fn in by_lang['sh']:
 | 
				
			||||||
        if custom_check_file(fn, bash_rules):
 | 
					        if custom_check_file(fn, bash_rules):
 | 
				
			||||||
            failed = True
 | 
					            failed = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -208,14 +208,14 @@ try:
 | 
				
			|||||||
    @lint
 | 
					    @lint
 | 
				
			||||||
    def jslint():
 | 
					    def jslint():
 | 
				
			||||||
        result = subprocess.call(['tools/node', 'tools/jslint/check-all.js']
 | 
					        result = subprocess.call(['tools/node', 'tools/jslint/check-all.js']
 | 
				
			||||||
                                 + by_lang['.js'])
 | 
					                                 + by_lang['js'])
 | 
				
			||||||
        return result
 | 
					        return result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @lint
 | 
					    @lint
 | 
				
			||||||
    def puppet():
 | 
					    def puppet():
 | 
				
			||||||
        if not by_lang['.pp']:
 | 
					        if not by_lang['pp']:
 | 
				
			||||||
            return 0
 | 
					            return 0
 | 
				
			||||||
        result = subprocess.call(['puppet', 'parser', 'validate'] + by_lang['.pp'])
 | 
					        result = subprocess.call(['puppet', 'parser', 'validate'] + by_lang['pp'])
 | 
				
			||||||
        return result
 | 
					        return result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @lint
 | 
					    @lint
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -80,7 +80,7 @@ def list_files(targets=[], ftypes=[], use_shebang=True, modified_only=False,
 | 
				
			|||||||
                continue
 | 
					                continue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if group_by_ftype:
 | 
					        if group_by_ftype:
 | 
				
			||||||
            result['.' + filetype].append(fpath)
 | 
					            result[filetype].append(fpath)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            result.append(fpath)
 | 
					            result.append(fpath)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user