I've changed as suggested in https://github.com/StevenBlack/hosts/pull/836#issuecomment-440452979 by @funilrys
The reason I choose NOT to convert this into ISO-8601 is, that we read date.time in different ways depending on with side on the pond we live. By using the "%d %B %Y %H:%M:%S (%Z)" Full date/time this issue is eliminated and any confusion on how to read the date is no longer existent. The ISO-8601 is good for active pages, as the date ordering is to be manipulated by interface.
Alternative to this is we should add extra lines/info about the date.time ordering, do to this i found this as the easiest way to give this information
Since some host files might need to be updated more frequently it's more appropriate to show timezone and the exact time for last build, hince changed the order of month and date to %d %B
This patch fixStevenBlack/hosts#777
This patch:
* Change the default state of keepdomaincomments.
* Indeed, comments are now displayed by default.
* But if you don't need comments, feel free to use the argument.
* Delete the requirement input when calling the `-k` argument.
* Update tests case regarding the new state of keepdomaincomments.
The following files:
* myhosts
* blacklist
* whitelist
can be all be modified by the user for personal usage.
However, git is tracking these files since they exist
in the repository, which makes it difficult to do so
without accidentally pushing one's own customizations.
This commit converts those examples to ".example" files,
which serve as the defaults if one of the files listed
above does not exist.
Closes gh-144.
Checking for zero-length is not necessary here as iterating over a
zero-length list is perfectly valid, and produces exactly zero
iterations, matching the intended behaviour without an extra check.
This patch review the way we get the comment at the end of a line.
I also did an application of DRY (Do not Repeat Yourself)
and/or KISS (Keep It Simple, Stupid) by refactoring the 2 `else`
statements into one line.
This option (--minimise, -m) differs from compress (--compress, -c) in
that it keeps each host on a different line, while still removing
unnecessary newlines and comments.
This is necessary because many implementations of URL blockers that rely
on hosts files do not conform to the standard which allows multiple
hosts on a single line.
An offset of 7 was hardcoded in the function compress_file, presumably
to skip over the default target IP address of 0.0.0.0 in a hosts file.
However, this causes problems when the default is overridden using the
--ip or -i flag, causing visibly garbled output in the generated hosts
file.
Fix is to calculate the length of target IP at runtime.