metadata: script to delete 0 size files and standardize whitespace
This commit is contained in:
		
							parent
							
								
									9897c97ef8
								
							
						
					
					
						commit
						7ce7b46ed2
					
				@ -43,6 +43,7 @@ test_lint_pmd_checkstyle:
 | 
			
		||||
    - ./gradlew pmd || export EXITVALUE=1
 | 
			
		||||
    - ./gradlew checkstyle || export EXITVALUE=1
 | 
			
		||||
    - ./tools/check-format-strings.py || export EXITVALUE=1
 | 
			
		||||
    - ./tools/check-fastlane-whitespace.py || export EXITVALUE=1
 | 
			
		||||
    - ./tools/remove-unused-and-blank-translations.py || export EXITVALUE=1
 | 
			
		||||
    - echo "These are unused or blank translations that should be removed:"
 | 
			
		||||
    - git --no-pager diff --ignore-all-space --name-only --exit-code app/src/*/res/values*/strings.xml || export EXITVALUE=1
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										15
									
								
								tools/check-fastlane-whitespace.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										15
									
								
								tools/check-fastlane-whitespace.py
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,15 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
 | 
			
		||||
import glob
 | 
			
		||||
import os
 | 
			
		||||
 | 
			
		||||
for f in glob.glob('metadata/*/*.txt') +  glob.glob('metadata/*/*/*.txt'):
 | 
			
		||||
    if os.path.getsize(f) == 0:
 | 
			
		||||
        os.remove(f)
 | 
			
		||||
        continue
 | 
			
		||||
 | 
			
		||||
    with open(f) as fp:
 | 
			
		||||
        data = fp.read()
 | 
			
		||||
    with open(f, 'w') as fp:
 | 
			
		||||
        fp.write(data.rstrip())
 | 
			
		||||
        fp.write('\n')
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user