Skip to content

Commit

Permalink
feat: just started 馃殌
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshadhin committed Jan 18, 2022
0 parents commit 693097c
Show file tree
Hide file tree
Showing 70 changed files with 648,060 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*.py]
max_line_length = 119
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = LF


[*.md]
trim_trailing_whitespace = false
insert_final_newline = true
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Enforce Unix newlines for all files
* text=auto eol=lf
21 changes: 21 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Configuration for welcome - https://github.com/behaviorbot/welcome

# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome

# Comment to be posted to on first time issues
newIssueWelcomeComment: >
Hello! Thank you for opening your first issue in this repo. It鈥檚 people like you who make these host files better!
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome

# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment: >
Thank you for submitting this pull request! We鈥檒l get back to you as soon as we can!
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge

# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment: >
Congratulations on merging your first pull request here! 馃帀馃帀馃帀 You are now in our [list of contributors](https://github.com/hrshadhin/hosts/graphs/contributors). Welcome!
# It is recommend to include as many gifs and emojis as possible!
Binary file added .github/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 120
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- bug
- discussion
- monitor (ongoing)
- enhancement
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
Closing.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
test:
name: Python ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
python:
- '3.5'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
os:
- ubuntu-latest


steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
cache: pip

- run: python --version
- run: pip --version

- name: Install Python dependencies
run: pip install -r requirements.txt

- name: Run lint
run: flake8

- name: Run tests
run: python test_helpers.py
36 changes: 36 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "CodeQL"

on:
push:
branches:
- master
- "!dependabot/**"
pull_request:
# The branches below must be a subset of the branches above
branches:
- master
- "!dependabot/**"
schedule:
- cron: "40 15 * * 4"
workflow_dispatch:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: "python"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.idea
venv
.venv
__pycache__/
blacklist
whitelist
custom_hosts
*.log
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# DON'T BE A DICK PUBLIC LICENSE

> Version 1.1, December 2016

> Copyright (C) 2022 H.R. Shadhin

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document.

> DON'T BE A DICK PUBLIC LICENSE
> TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

1. Do whatever you like with the original work, just don't be a dick.

Being a dick includes - but is not limited to - the following instances:

1a. Outright copyright infringement - Don't just copy this and change the name.
1b. Selling the unmodified original with no work done what-so-ever, that's REALLY being a dick.
1c. Modifying the original work to contain hidden harmful content. That would make you a PROPER dick.

2. If you become rich through modifications, related works/services, or supporting the original work,
share the love. Only a dick would make loads off this work and not buy the original work's
creator(s) a pint.

3. Code is provided with no warranty. Using somebody else's code and bitching when it goes wrong makes
you a DONKEY dick. Fix the problem yourself. A non-dick would submit the fix back.
52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.PHONY: all

all: help

help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'


########################
### Build and TEST ###
########################

build: ## Update hosts files
@echo "updating hosts files..."
@python update_hosts_file.py

build-min: ## Update hosts files and minimise output file
@echo "updating minimise hosts file..."
@python update_hosts_file.py -m

build-bb-list: ## Update block list for Blocky(DNS proxy)
@echo "updating slim hosts file..."
@python update_hosts_file.py -m -s -e -o bb_list.txt

build-for-hrs: ## Update files for HRS
@echo "updating hosts files..."
@python update_hosts_file.py
@echo "*********** + ***********"
@echo "updating slim hosts file..."
@python update_hosts_file.py -n -nr -m -s -e -o bb_list.txt

test: ## Run unit tests
@echo "running tests..."
@python test_helpers.py

clean: ## Remove junk
@rm -rf __pycache__ *.log


########################
### GIT REMOTE ###
########################

pull: ### Pull from git repository
@echo "pulling changes from git remote"
@git pull origin master

push: ### Push to git repository
@echo "pushing changes to git remote"
@git add .
@git commit -m "hosts updated"
@git push -u origin master
Loading

0 comments on commit 693097c

Please sign in to comment.