summaryrefslogtreecommitdiffstats
path: root/tools/checkdeps
Commit message (Collapse)AuthorAgeFilesLines
* Add ability to write include rules specific to subsets of files in a directory.joi@chromium.org2012-08-139-36/+147
| | | | | | | | | | | | | This is useful e.g. to limit a set of allowed or temporarily-allowed include rules to test files, or to allow certain includes in .cc files but not in .h files. BUG=138280 Review URL: https://chromiumcodereview.appspot.com/10823271 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151301 0039d316-1c4b-4281-b951-d872f2087c98
* Add ability to format errors as a list of temp-allow rules to pastejoi@chromium.org2012-08-016-160/+297
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into a DEPS file. The idea behind this change is that the tool now lets you do this: a) Update a DEPS file for some directory with the intended rules for the directory, e.g. rules disallowing certain directories (say "chrome/browser") and allowing others (e.g. "chrome/browser/apis"). b) Run this tool on that particular directory to generate a list of temp-allow rules. c) Paste the temp-allow rules into the DEPS file for the directory. d) Work on eliminating dependencies until the temp-allow rules list in the DEPS file reaches zero. To accomplish this change, and fix the bug that existed that the checkdeps tool didn't work correctly if you specified a start directory, I refactored the code to always use the approach I had introduced in CheckAddedCppIncludes, which when you request rules for a given directory generates all parent directories' rules first, up to the base directory. Also, to enable better extraction of error information for the eventual formatter, I externalized formatting to separate classes and had the code collect only the logical error information. While in there, fixed use of quotes to match coding standard. BUG=138280 Review URL: https://chromiumcodereview.appspot.com/10832062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149455 0039d316-1c4b-4281-b951-d872f2087c98
* Add checkdeps presubmit check. Warns on new #includes of dependenciesjoi@chromium.org2012-07-312-1/+9
| | | | | | | | | | | we are working to eliminate, and errors on new #includes of disallowed dependencies. BUG=138280 Review URL: https://chromiumcodereview.appspot.com/10806049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149167 0039d316-1c4b-4281-b951-d872f2087c98
* Implement ability to specify temporarily-allowed dependencies in DEPSjoi@chromium.org2012-07-3114-295/+592
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | files, and use this ability in a few DEPS files where appropriate. This has no effect on the normal running of checkdeps; "!" dependencies are treated just like "+" dependencies when checkdeps is run on our bots. An upcoming change will use the new checkdeps.CheckAddedIncludes function, and will error out if you add a new include that violates a "-" rule, and show a presubmit warning when you add a new include that violates a "!" rule (the warning will say something like "We are in the process of removing dependencies from this directory to that file, can you avoid adding more?" While I was in there, fixed path handling so that checkdeps will work on case-sensitive platforms with paths that include upper-case characters (e.g. a checkout of Chrome at ~/c/Chrome/src rather than ~/c/chrome/src). Since the pipes.quote method seems unreliable on Windows (it failed on my setup), switched to subprocess.list2cmdline which I believe is stable. Added a small manual testing mode to checkdeps. It currently only verifies the CheckAddedIncludes function. TBR=jam@chromium.org BUG=138280 Review URL: https://chromiumcodereview.appspot.com/10805042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149163 0039d316-1c4b-4281-b951-d872f2087c98
* Add Java support to checkdeps.pyhusky@chromium.org2012-07-243-131/+232
| | | | | | | | | | | | | | | | | | | | | | I've moved the C++-specific parts of checkdeps.py into objcpp_checker.py, and added a corresponding java_checker.py module for Java code. The Java module does an extra pass over the files (see Pydoc for details) but this has almost no impact on the overall running time. The Java checker is intended to be compatible with the existing DEPS format despite Java's different import mechanism. In the Android repo, there are a few extra DEPS files needed for the Java code. That code has not yet been upstreamed back to Chromium, so those DEPS aren't needed yet -- they can be added as and when they're needed. BUG=137081 TEST=checkdeps.py Review URL: https://chromiumcodereview.appspot.com/10790014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148094 0039d316-1c4b-4281-b951-d872f2087c98
* Change checkdeps.py to stop scanning after a certain number of non-include ↵mattm@chromium.org2012-06-081-13/+24
| | | | | | | | | | | | | | | | lines. Previously it would always scan 150 lines, even if the file had more includes than that. Also, break out of the loop once we reach the end of the file, rather than looping and testing the empty string until we hit the limit. BUG=131315 TEST=In a file with lots of includes, introduce an illegal one at the end. Run checkdeps. Review URL: https://chromiumcodereview.appspot.com/10537069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141283 0039d316-1c4b-4281-b951-d872f2087c98
* Don't make checkdeps ignore includes to directories that are brought in via ↵jam@chromium.org2012-04-271-16/+3
| | | | | | | | deps. Most of these are already listed in DEPS files, and it seems that we want to prevent includes on them just like normal directories that are in our tree (otherwise content can depend on native_client, for ex) Review URL: https://chromiumcodereview.appspot.com/10248005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134296 0039d316-1c4b-4281-b951-d872f2087c98
* Fix python scripts in src/tools/maruel@chromium.org2011-11-291-7/+14
| | | | | | | | | | | | | | | | | | Make sure that: - shebang is only present for executable files - shebang is #!/usr/bin/env python - __main__ is only present for executable files - file's executable bit is coherent Also fix EOF LF to be only one. TBR=timurrrr@chromium.org BUG=105108 TEST= Review URL: http://codereview.chromium.org/8678023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111960 0039d316-1c4b-4281-b951-d872f2087c98
* Allow checkdeps to function in the presence of File().bradnelson@google.com2011-11-211-1/+8
| | | | | | | | | | | This will allow a verbatim migration of the nacl sdk into chrome. BUG=None TEST=None R=noelallen@google.com Review URL: http://codereview.chromium.org/8609003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110870 0039d316-1c4b-4281-b951-d872f2087c98
* Fix checkdeps.py to check all the source directories in git checkouts.kinaba@chromium.org2011-10-281-1/+4
| | | | | | | | | | | BUG=33165 TEST=Manual: add an invalid #include in ppapi/examples/ime/ime.cc and verify it to be correctly warned. Review URL: http://codereview.chromium.org/8416016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107668 0039d316-1c4b-4281-b951-d872f2087c98
* Update checkdeps to deal with the more recent From() syntax, and re-enablebrettw@chromium.org2011-07-121-1/+1
| | | | | | | | | | | From() usage for pulling NaCl's copy of PPAPI. TEST=checkdeps BUG=none Review URL: http://codereview.chromium.org/7347012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92194 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 84470 (we want DEPS files to stay simple as discussed in irc. Also, ↵thakis@chromium.org2011-05-061-7/+2
| | | | | | | | | | | | | this broke tools/sync-webkit-git.py) - Remove nacl_tools_revision and get the appropriate folders/revisions from native client's DEPS file BUG=none TEST=trybots,gclient sync Review URL: http://codereview.chromium.org/6933043 TBR=elijahtaylor@google.com Review URL: http://codereview.chromium.org/6952009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84485 0039d316-1c4b-4281-b951-d872f2087c98
* Remove nacl_tools_revision and get the appropriate folders/revisions from ↵elijahtaylor@google.com2011-05-061-2/+7
| | | | | | | | | | native client's DEPS file BUG=none TEST=trybots,gclient sync Review URL: http://codereview.chromium.org/6933043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84470 0039d316-1c4b-4281-b951-d872f2087c98
* Fix up checkdepsthomasvl@chromium.org2011-04-151-3/+3
| | | | | | | | | | | - use the options to get the root, don't assume the layout of sys.argv. - if no root was set, use __file__ instead of assuming sys.argv[0] will be a full path. BUG=none TEST=none Review URL: http://codereview.chromium.org/6871014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81752 0039d316-1c4b-4281-b951-d872f2087c98
* Revert accidental checkin.jam@chromium.org2011-02-251-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75997 0039d316-1c4b-4281-b951-d872f2087c98
* Move appcache/file_sytem/device_orientation subdirectories of chrome\browser ↵jam@chromium.org2011-02-241-1/+1
| | | | | | | | | to content\browser. TBR=avi Review URL: http://codereview.chromium.org/6586001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75990 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bug with checkdeps on OS X and git.akalin@chromium.org2010-09-101-1/+1
| | | | | | | | | | | | | Basically, checkdeps on OS X and git is a no-op without this fix, as OS X (almost always) has a case-insensitive file system and checkdeps does case-sensitive comparisons. BUG=none TEST=ran checkdeps before/after Review URL: http://codereview.chromium.org/3356015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59066 0039d316-1c4b-4281-b951-d872f2087c98
* Modify checkdeps.py so that it only looks for files named DEPS, notdmazzoni@chromium.org2010-08-261-1/+1
| | | | | | | | | | | directories. BUG=53498 TEST=manually tried checkdeps.py before and after, verified that it now ignores a directory named DEPS Review URL: http://codereview.chromium.org/3155049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57582 0039d316-1c4b-4281-b951-d872f2087c98
* Modify checkdeps.py to work with git.satorux@chromium.org2010-02-081-3/+33
| | | | | | | | | BUG=33118 TEST=none Review URL: http://codereview.chromium.org/566029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38349 0039d316-1c4b-4281-b951-d872f2087c98
* Also scan .m and .mm files in checkdeps.pyphajdan.jr@chromium.org2009-05-181-11/+10
| | | | | | | | | | - add necessary DEPS rules - fix skia includes in test_shell to contain full path (third_party/skia/include/core/SkBitmap.h instead of just SkBitmap.h) - remove forbidden chrome/common include from app/resource_bundle_mac.mm Review URL: http://codereview.chromium.org/113147 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16273 0039d316-1c4b-4281-b951-d872f2087c98
* Let checkdeps ignore #if 0 blocks. Also strip lines of leading/trailing ↵thestig@chromium.org2009-03-181-1/+14
| | | | | | | | whitespaces before checking. Review URL: http://codereview.chromium.org/42316 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11986 0039d316-1c4b-4281-b951-d872f2087c98
* Use unix path separators in checkdeps. Otherwise it doesn't work on Unix ↵thestig@chromium.org2009-02-271-3/+1
| | | | | | | | systems. Review URL: http://codereview.chromium.org/27253 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10588 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the dependency checker tool. Rules for a directory did modify their ↵stoyan@chromium.org2009-02-051-8/+10
| | | | | | | | | | directory parent rules. Using copy.copy() solves the problem.Additional fix when "allow-current-directory" rules was not applied if DEPS file is missing. Updated few DEPS file with reasonable rules. To prevent tree closing other dependencies are added. These need to be either legitimated or dependency removed. Review URL: http://codereview.chromium.org/21025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9221 0039d316-1c4b-4281-b951-d872f2087c98
* Use Vars for the webkit repo and revision number. This wayojan@google.com2009-02-031-5/+17
| | | | | | | | | | we can override the via custom_vars in .gclient on the bots and official builds updates the merge script appropriately. Also updates checkdeps to be Var-aware. Review URL: http://codereview.chromium.org/19508 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9098 0039d316-1c4b-4281-b951-d872f2087c98
* Apply svn:executable to .py files which should have it.phajdan.jr@chromium.org2008-12-121-0/+1
| | | | | | Review URL: http://codereview.chromium.org/14012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6884 0039d316-1c4b-4281-b951-d872f2087c98
* Move subdirectory skipping from being in the DEPS file of the directory to ↵brettw@google.com2008-08-261-16/+15
| | | | | | | | skip and instead have in in the parent. This allows us to pull third-party sources or external repositories and not have to make them add a DEPS file for our deps checker. BUG=1342686 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1358 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a number of bugs in checkdeps now that I actually ran it on the Chrome tree.brettw@google.com2008-08-081-12/+18
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@599 0039d316-1c4b-4281-b951-d872f2087c98
* Recursively search directories in the source tree and verify includes.brettw@google.com2008-08-071-0/+461
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@545 0039d316-1c4b-4281-b951-d872f2087c98