Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NXP] Add to flake8 in workflow and fix python files (part #25193) #25305

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ exclude = third_party
examples/common/pigweed/rpc_console/py/chip_rpc/console.py
examples/lighting-app/python/lighting.py
examples/platform/mbed/ota/generate_ota_list_image.py
examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py
scripts/build/build/target.py
scripts/build/build/targets.py
scripts/build/builders/android.py
Expand Down Expand Up @@ -81,9 +80,6 @@ exclude = third_party
scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py
scripts/tools/nrfconnect/nrfconnect_generate_partition.py
scripts/tools/nrfconnect/tests/test_generate_factory_data.py
scripts/tools/nxp/factory_data_generator/custom.py
scripts/tools/nxp/factory_data_generator/default.py
scripts/tools/nxp/factory_data_generator/generate.py
scripts/tools/silabs/FactoryDataProvider.py
scripts/tools/telink/mfg_tool.py
scripts/tools/zap/generate.py
Expand Down
6 changes: 3 additions & 3 deletions examples/platform/nxp/k32w/k32w0/scripts/detokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def decode_string(tstr, detok):
if s.find('$') == 0:
return None
return s
except:
except ValueError:
return None


Expand Down Expand Up @@ -88,7 +88,7 @@ def decode_serial(serialport, outfile, database):
print(line, file=sys.stdout)
if output:
print(line, file=output)
except:
except Exception:
print("Serial error or program closed", file=sys.stderr)

if output:
Expand Down Expand Up @@ -120,7 +120,7 @@ def decode_file(infile, outfile, database):
# ascii decode line
# serial terminals may include non ascii characters
line = line.decode('ascii').strip()
except:
except Exception:
continue
# find token start and detokenize
idx = line.rfind(']')
Expand Down
2 changes: 1 addition & 1 deletion scripts/tools/nxp/factory_data_generator/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def custom_function(self):

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.serialization import load_der_private_key
from default import *
from default import Base64Argument, FileArgument, IntArgument, StrArgument


class Verifier(Base64Argument):
Expand Down
1 change: 0 additions & 1 deletion scripts/tools/nxp/factory_data_generator/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import base64
import logging
import sys


class InputArgument:
Expand Down
5 changes: 3 additions & 2 deletions scripts/tools/nxp/factory_data_generator/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
import argparse
import hashlib
import logging
import os
import subprocess
import sys

from custom import *
from custom import (CertDeclaration, DacCert, DacPKey, Discriminator, HardwareVersion, HardwareVersionStr, IterationCount,
ManufacturingDate, PaiCert, PartNumber, ProductId, ProductLabel, ProductName, ProductURL, Salt, SerialNum,
SetupPasscode, StrArgument, UniqueId, VendorId, VendorName, Verifier)
from default import InputArgument


Expand Down