Skip to content

Commit

Permalink
Updating Python Static Analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottGibb committed Nov 6, 2023
1 parent 4365ae0 commit 4c4f50b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Static Analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Run pylint
run: |
echo "Checking Python files with pylint"
pylint --fail-under=9 ./src
pylint --fail-under=8 ./src
YAML_Lint_Check:
name: YAML Lint Check
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ ignore-none=yes
ignore-on-opaque-inference=yes

# List of symbolic message names to ignore for Mixin members.
ignored-checks-for-mixins=no-member,
ignored-checks-for-mixins=
not-async-context-manager,
not-context-manager,
attribute-defined-outside-init
Expand Down
10 changes: 5 additions & 5 deletions src/socket_transmitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def main(ip_addr: str = DEFAULT_IP_ADDRESS, port_num:int = DEFAULT_PORT_NUM, tra
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((ip_addr, port_num))
sock.listen()
log.info("Listening on Port: {0} at {1}".format(port_num,ip_addr))
log.info("Transmitting on Pin: {0}".format(transmit_pin))
log.info(f"Listening on Port: {port_num} at {ip_addr}")
log.info(f"Transmitting on Pin: {transmit_pin}")
conn, _ = sock.accept()
log.info("Accepted Connection")
sock_file = conn.makefile()
Expand Down Expand Up @@ -84,7 +84,7 @@ def transmit_rf_code(code: str, short_delay: float, long_delay: float, trsmt_pin
"""
log.info("Transmitting")
for t in range(NUM_ATTEMPTS):
log.debug("Attempt: %s", str(t))
log.debug(f"Attempt: {t}")
for i in code:
if i == '1':
GPIO.output(trsmt_pin, 1)
Expand All @@ -97,7 +97,7 @@ def transmit_rf_code(code: str, short_delay: float, long_delay: float, trsmt_pin
GPIO.output(trsmt_pin, 0)
time.sleep(short_delay)
else:
log.critical("Received invalid Code: %s", str(code))
log.critical(("Received invalid Code: %s", str(code)))
GPIO.output(trsmt_pin, 0)
time.sleep(RETRY_TIME)
time.sleep(0.5)
Expand All @@ -117,5 +117,5 @@ def setup_logging() -> None:
if __name__ == '__main__':
setup_logging()
log.info("RF Smart Transmitter Booting")
log.info("Arguments Received:\n {0}".format(args))
log.info(f"Arguments Received:\n ,{args}")
main(args.ip_address, args.port_number, args.pin_number)

0 comments on commit 4c4f50b

Please sign in to comment.