Skip to content

Commit 67ec78e

Browse files
authored
Merge pull request adafruit#71 from brentru/error-on-non-ssl
add a log statement for non-ssl errors, update pre-commit
2 parents c518e55 + 507b606 commit 67ec78e

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ jobs:
5050
- name: Pre-commit hooks
5151
run: |
5252
pre-commit run --all-files
53-
- name: PyLint
54-
run: |
55-
pylint $( find . -path './adafruit*.py' )
56-
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
57-
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*/*.py" ))
5853
- name: Build assets
5954
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
6055
- name: Archive bundles
6156
uses: actions/upload-artifact@v2
6257
with:
6358
name: bundles
6459
path: ${{ github.workspace }}/bundles/
60+
- name: Check For docs folder
61+
id: need-docs
62+
run: |
63+
echo ::set-output name=docs::$( find . -wholename './docs' )
6564
- name: Build docs
65+
if: contains(steps.need-docs.outputs.docs, 'docs')
6666
working-directory: docs
6767
run: sphinx-build -E -W -b html . _build/html
6868
- name: Check For setup.py

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,18 @@ repos:
1717
- id: check-yaml
1818
- id: end-of-file-fixer
1919
- id: trailing-whitespace
20+
- repo: https://github.com/pycqa/pylint
21+
rev: pylint-2.7.1
22+
hooks:
23+
- id: pylint
24+
name: pylint (library code)
25+
types: [python]
26+
exclude: "^(docs/|examples/|setup.py$)"
27+
- repo: local
28+
hooks:
29+
- id: pylint_examples
30+
name: pylint (examples code)
31+
description: Run pylint rules on "examples/*.py" files
32+
entry: /usr/bin/env bash -c
33+
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']
34+
language: system

adafruit_minimqtt/adafruit_minimqtt.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,15 @@ def _get_connect_socket(self, host, port, *, timeout=1):
227227
"ssl_context must be set before using adafruit_mqtt for secure MQTT."
228228
)
229229

230+
if self.logger and port == MQTT_TLS_PORT:
231+
self.logger.info(
232+
"Establishing a SECURE SSL connection to {0}:{1}".format(host, port)
233+
)
234+
else:
235+
self.logger.info(
236+
"Establishing an INSECURE connection to {0}:{1}".format(host, port)
237+
)
238+
230239
addr_info = self._socket_pool.getaddrinfo(
231240
host, port, 0, self._socket_pool.SOCK_STREAM
232241
)[0]

0 commit comments

Comments
 (0)