And here we are... I made a changelog, so I might as well post it.
Note: I just made a push -f to overwrite my initial commit with a UTF-8 version of the file. If you downloaded the repo previously, please re-clone it from scratch. Future commits will avoid forced pushes, I just thought -- who cares, it's an initial commit.
https://github.com/Wedge/tools/ (<-- hmm, should I adopt 'wedge' or 'Wedge' in the URL..?)
Released under the MIT license.
85 insertions(+), 8 deletions(-)
Auto-fixing, cosmetic updates and improvements.
+ The script will now attempt to fix the files for you, at least if they seem safe to work on. Add the ?fixme parameter, but don't forget to do a dry-run before.
@ Known potential false positives that aren't detected yet: globals declared inside a string (sometimes it'll work, in create_function for instance), and inside multi-line comments (i.e. commented out code.) If you use this script, don't fixme blindly, and check all changes manually before committing your work.
@ Duplicate globals aren't auto-fixed. You'll have to do these manually, at least for now.
+ Proper HTML styling. You no longer have to view-source in order to make it usable.
+ Support for all line-ending types.
- Removed false positive: use of 'global $something' inside a line (e.g. a comment), with text preceding it that isn't a bracket.
+ Adding a warning (and not auto-fixing) in case an unused global was found in a function, but also the following: $$ (perhaps a variable variable has your global name in it?), ${$ (another syntax for variable variables), include(), require() and their _once() variations. The script will indicate which of these it found, and keep going its way.
Note: I just made a push -f to overwrite my initial commit with a UTF-8 version of the file. If you downloaded the repo previously, please re-clone it from scratch. Future commits will avoid forced pushes, I just thought -- who cares, it's an initial commit.
https://github.com/Wedge/tools/ (<-- hmm, should I adopt 'wedge' or 'Wedge' in the URL..?)
Released under the MIT license.
85 insertions(+), 8 deletions(-)
Auto-fixing, cosmetic updates and improvements.
+ The script will now attempt to fix the files for you, at least if they seem safe to work on. Add the ?fixme parameter, but don't forget to do a dry-run before.
@ Known potential false positives that aren't detected yet: globals declared inside a string (sometimes it'll work, in create_function for instance), and inside multi-line comments (i.e. commented out code.) If you use this script, don't fixme blindly, and check all changes manually before committing your work.
@ Duplicate globals aren't auto-fixed. You'll have to do these manually, at least for now.
+ Proper HTML styling. You no longer have to view-source in order to make it usable.
+ Support for all line-ending types.
- Removed false positive: use of 'global $something' inside a line (e.g. a comment), with text preceding it that isn't a bracket.
+ Adding a warning (and not auto-fixing) in case an unused global was found in a function, but also the following: $$ (perhaps a variable variable has your global name in it?), ${$ (another syntax for variable variables), include(), require() and their _once() variations. The script will indicate which of these it found, and keep going its way.