Indeed, before this patch, no `# Title: XYZ` was describing our generated
host file. This patch fixes that.
Indeed, we now do the following:
- If no extension is included we add:
- `# Title: StevenBlack/hosts`
- If exactly one extension is included we add:
- `# Title: StevenBlack/hosts with the extension_name extension`
- If more than one extension is included we add (in one line):
- `# Title: StevenBlack/hosts with the extname1,
extname2 and extname3 extensions`
Please also note that I disable E203 (whitespace before ':') for flake8
at line 773.
Since we use Black for code formatting let me redirect you to
the documentation of Black which explain what I did.
https://black.readthedocs.io/en/stable/the_black_code_style.html#slices :
> Since E203 is not PEP 8 compliant, you should tell
> Flake8 to ignore these warnings.
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.