tir38 / android-lint-entropy-reducer Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] ruby script to ensure that your Lint error/warning count never increases
[DEPRECATED] ruby script to ensure that your Lint error/warning count never increases
Should be able to make script work with Travis and BuddyBuild
If for some reason the gradle lint task fails the build should also fail.
Should this script run separately for each Gradle build variant?
Per advice from @matthew-compton,
It would be great if this script kept track of errors or warnings introduced by this PR then that would make it easier for a developer to fix just the Lint errors that he/she created.
Right now the developer would just have to fix any Lint errors totalling the number he/she added.
Android has updated it’s HTML file output in Android build tools 2.3.0. Now instead of displaying “0 errors and x warnings” it will display “Lint Report: x warnings”. This causes the following error as error_warning_string
is now null as it no longer matches.
./Resources/lint-up.rb:74:in `<main>': undefined method `match' for nil:NilClass (NoMethodError)
Errors and warnings need to be checked independently in order for this tool to work correctly. I have fixed this on my side but since this is a private repository I can't create a pull request.
Here are my changes if anyone else if having this issue.
# find error/warning count string in HTML report
error_string = ""
warning_string = ""
File.open lint_report do |file|
error_string = file.find { |line| line =~ /[0-9]* errors/ }
warning_string = file.find { |line| line =~ /[0-9]* warnings/ }
end
# find number of errors
current_error_count = error_string.match(/[0-9]*/)[0].to_i
puts "found errors: " + current_error_count.to_s
# find number of warnings
if CHECK_WARNINGS == true
current_warning_count = warning_string.match(/[0-9]*/)[0].to_i
puts "found warnings: " + current_warning_count.to_s
end
# write new results to file (will overwrite existing, or create new)
File.write(previous_lint_report, "DO NOT TOUCH; GENERATED BY TRAVIS\n" + error_string + " and " + warning_string)
Sometimes (not sure how yet) the lint-results.xml file is involved in a merge conflict. Maybe add a note about how to fix it.
Knowing exactly what lint errors/warnings Travis is catching will help a lot.
We shouldn't be updating global git user info anyways. Just in case something goes wrong with re-setting user info, we don't want to have screwed up somebody's entire git setup. We should switch to local user info.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.