diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efece2eb..13f133c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,9 @@ jobs: - uses: taiki-e/install-action@just - uses: taiki-e/install-action@dprint + - uses: taiki-e/install-action@v2 + with: + tool: typos-cli - name: Lint # currently cli is not-maintained diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000..8d2cbaa3 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,3 @@ +[files] +# cli is not maitained +extend-exclude = ["CHANGELOG.md", "cli/", "*.excalidraw"] diff --git a/agent/compose.example.yml b/agent/compose.example.yml index 20d84ec0..ff39a268 100644 --- a/agent/compose.example.yml +++ b/agent/compose.example.yml @@ -23,7 +23,7 @@ services: # using 127.0.0.1 or localhost won't make it work # set it to RESTKNOT API IP - RESTKNOT_KAFKA_BROKERS=10.0.0.1:9092,10.0.0.2:9092,10.0.0.3:9092 - # topic to suscribe + # topic to subscribe - RESTKNOT_KAFKA_TOPIC=domaindata # consumer group id - RESTKNOT_KAFKA_GROUP_ID=master1 diff --git a/agent/dnsagent/agent.py b/agent/dnsagent/agent.py index 9c23715e..5d0ae0ef 100644 --- a/agent/dnsagent/agent.py +++ b/agent/dnsagent/agent.py @@ -34,7 +34,7 @@ def execute(message): identifier=message.get("identifier"), filters=message.get("filters"), ) - # `resp = ctl.receive_block()` receive nothing when the operation is succesfull + # `resp = ctl.receive_block()` receive nothing when the operation is successful # calling it just a waste of resources logger.info(f"Success: {cmd} {zone or ''} {item or ''} {data or ''}") except libknot.control.KnotCtlError as knot_error: diff --git a/api/app/helpers/producer.py b/api/app/helpers/producer.py index d6d42cec..a39ed4e6 100644 --- a/api/app/helpers/producer.py +++ b/api/app/helpers/producer.py @@ -16,7 +16,7 @@ def kafka_admin(): except KeyError: raise ValueError("Can't find brokers list in config") - # `AdmintClient` can't recive list of brokers + # `AdmintClient` can't receive list of brokers conf = {"bootstrap.servers": brokers[0]} admin_client = AdminClient(conf) return admin_client diff --git a/api/app/helpers/validator.py b/api/app/helpers/validator.py index 8dd40206..ed7e6a9b 100644 --- a/api/app/helpers/validator.py +++ b/api/app/helpers/validator.py @@ -32,14 +32,14 @@ def is_valid_ip(ip): try: ip_address(ip) except ValueError: - raise ValueError("Bad IP Adrress") + raise ValueError("Bad IP Address") def is_valid_email(email): """Check if it's a valid email address.""" match = re.match(RE_EMAIL, email) if match is None: - raise ValueError("Bad Email Adrress") + raise ValueError("Bad Email Address") def is_valid_mx(mx_rdata): @@ -137,15 +137,15 @@ def is_valid_owner(owner): - owner can't contains parens ("()") """ - def check_hypen(label): + def check_hyphen(label): if any((label.endswith("."), label.endswith("-"), label.startswith("-"))): raise ValueError("Bad OWNER") - check_hypen(owner) + check_hyphen(owner) if "." in owner: for label in owner.split("."): - check_hypen(label) + check_hyphen(label) if len(owner) > 255: raise ValueError("Bad OWNER") diff --git a/api/app/models/model.py b/api/app/models/model.py index 5d70104d..240efeaf 100644 --- a/api/app/models/model.py +++ b/api/app/models/model.py @@ -80,13 +80,13 @@ def insert(table, data=None): rows.append(row) rows_value.append(str(data[row])) - str_placeholer = ["%s"] * len(rows) + str_placeholder = ["%s"] * len(rows) try: rows = ",".join(rows) - str_placeholer = ",".join(str_placeholer) + str_placeholder = ",".join(str_placeholder) - query = f'INSERT INTO "{table}" ({rows}) VALUES ({str_placeholer}) RETURNING *' + query = f'INSERT INTO "{table}" ({rows}) VALUES ({str_placeholder}) RETURNING *' cursor.prepare(query) cursor.execute((tuple(rows_value))) except (Exception, psycopg2.DatabaseError) as error: diff --git a/api/compose.example.yml b/api/compose.example.yml index b1901ea6..bb49650e 100644 --- a/api/compose.example.yml +++ b/api/compose.example.yml @@ -16,13 +16,13 @@ services: - APP_HOST=0.0.0.0 # default 0.0.0.0 - APP_PORT=5000 # default 8000 - - DB_NAME=knotdb # don't add whitespace beetween = + - DB_NAME=knotdb # don't add whitespace between = - DB_HOST=roach - DB_PORT=26257 - DB_USER=root - DB_SSL=disable - # topic to suscribe + # topic to subscribe - RESTKNOT_KAFKA_TOPIC=domaindata # don't add quote, otherwise it will not work diff --git a/docs/examples/playbooks/ansible.cfg b/docs/examples/playbooks/ansible.cfg index 616b3072..decf9f20 100644 --- a/docs/examples/playbooks/ansible.cfg +++ b/docs/examples/playbooks/ansible.cfg @@ -1,3 +1,3 @@ [defaults] inventory = ./hosts.yml -host_key_checking = False # don't promt for ssh 'un'-known hosts +host_key_checking = False # don't prompt for ssh 'un'-known hosts diff --git a/docs/examples/playbooks/initial-setups.yml b/docs/examples/playbooks/initial-setups.yml index 9d144338..ccbed582 100644 --- a/docs/examples/playbooks/initial-setups.yml +++ b/docs/examples/playbooks/initial-setups.yml @@ -1,4 +1,4 @@ -# tested againts CentOS 7.5 +# tested against CentOS 7.5 --- - hosts: all diff --git a/docs/examples/playbooks/setup-api.yml b/docs/examples/playbooks/setup-api.yml index 9fb83839..5eff15fd 100644 --- a/docs/examples/playbooks/setup-api.yml +++ b/docs/examples/playbooks/setup-api.yml @@ -38,7 +38,7 @@ - "schema.sql" - name: Check if docker exists - # changing PATH is dangerous. it's bettter to + # changing PATH is dangerous. it's better to # just use a full path command: ~/.local/bin/docker-compose -v args: diff --git a/docs/howto.rst b/docs/howto.rst index 0d89907b..99262979 100644 --- a/docs/howto.rst +++ b/docs/howto.rst @@ -19,7 +19,7 @@ To make sure that the records were created on the Knot side. Use ``dig`` or ``kd $ kdig @localhost example.com SOA +short -Add/Edit/Remove spesific Record +Add/Edit/Remove specific Record ------------------------------- To add/edit/remove specific record you can use :code:`/record/add`, diff --git a/docs/knotintro.rst b/docs/knotintro.rst index 4140cb7d..081859f2 100644 --- a/docs/knotintro.rst +++ b/docs/knotintro.rst @@ -326,7 +326,7 @@ These are common command operation to give you insight how to do things: $ # use +tcp if your ISP provider annoys you $ kdig @localhost niu.com SOA +short +tcp - $ # start everyting from scratch + $ # start everything from scratch $ # stop knotd and knot-agent # rm -rf * /var/lib/knot # remove all knot db # rm -rf * /etc/knot # most of the time, it doesn't needed diff --git a/justfile b/justfile index 8eedf74d..c6eb2243 100644 --- a/justfile +++ b/justfile @@ -25,3 +25,5 @@ fmt-check: # Lint the codebase. lint: + # Run `typos --write-changes` to fix the mistakes + typos