pointhi/kicad-footprint-generator

View on GitHub

Showing 257 of 257 total issues

Ambiguous variable name 'l'
Open

            default = [l-1 for l in self.via_layout]

Never use the characters 'l', 'O', or 'I' as variable names.

In some fonts, these characters are indistinguishable from the
numerals one and zero. When tempted to use 'l', use 'L' instead.

Okay: L = 0
Okay: o = 123
Okay: i = 42
E741: l = 0
E741: O = 123
E741: I = 42

Variables can be bound in several other contexts, including class
and function definitions, 'global' and 'nonlocal' statements,
exception handlers, and 'with' and 'for' statements.
In addition, we have a special handling for function parameters.

Okay: except AttributeError as o:
Okay: with lock as L:
Okay: foo(l=12)
Okay: for a in foo(l=12):
E741: except AttributeError as O:
E741: with lock as l:
E741: global I
E741: nonlocal l
E741: def foo(l):
E741: def foo(l=12):
E741: l = foo(l=12)
E741: for l in range(10):
E742: class I(object):
E743: def l(x):

Blank line at end of file
Open

Severity: Minor
Found in docs/conf.py by pep8

Trailing blank lines are superfluous.

Okay: spam(1)
W391: spam(1)\n

However the last line should end with a new line (warning W292).

Don't use variables in the printf format string. Use printf "..%s.." "$foo".
Open

    [ -z "$1" ] || printf "Error: $1\n"
Severity: Minor
Found in manage.sh by shellcheck

Don't use variables in the printf format string. Use printf "..%s.." "$foo".

Problematic code:

printf "Hello, $NAME\n"

Correct code:

printf "Hello, %s\n" "$NAME"

Rationale:

printf interprets escape sequences and format specifiers in the format string. If variables are included, any escape sequences or format specifiers in the data will be interpreted too, when you most likely wanted to treat it as data. Example:

coverage='96%'
printf "Unit test coverage: %s\n" "$coverage"
printf "Unit test coverage: $coverage\n"

The first printf writes Unit test coverage: 96%.

The second writes bash: printf: `\': invalid format character

Exceptions

Sometimes you may actually want to interpret data as a format string, like in:

hexToAscii() { printf "\x$1"; }
hexToAscii 21

or when you have a pattern in a variable:

filepattern="file-%d.jpg"
printf -v filename "$filepattern" "$number"

These are valid use cases with no useful rewrites. Please [[ignore]] the warnings with a [[directive]].

Notice

Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.

Use $(..) instead of legacy ...
Open

    PYTHONPATH=`pwd` python -m nose2 -C --coverage "$KICADMODTREE_DIR" --coverage-report term-missing -s "$KICADMODTREE_DIR/tests"
Severity: Minor
Found in manage.sh by shellcheck

Use $(STATEMENT) instead of legacy `STATEMENT`

Problematic code

echo "Current time: `date`"

Correct code

echo "Current time: $(date)"

Rationale

Backtick command substitution `STATEMENT` is legacy syntax with several issues.

  1. It has a series of undefined behaviors related to quoting in POSIX.
  2. It imposes a custom escaping mode with surprising results.
  3. It's exceptionally hard to nest.

$(STATEMENT) command substitution has none of these problems, and is therefore strongly encouraged.

Exceptions

None.

See also

Notice

Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.

TODO found
Open

        # TODO: allow writing into sub dir
Severity: Minor
Found in KicadModTree/ModArgparser.py by fixme

TODO found
Open

                pass  # TODO: throw warning because drill is not supported
Severity: Minor
Found in KicadModTree/nodes/base/Pad.py by fixme

TODO found
Open

            # TODO make size calculation more resilient

TODO found
Open

        self.width = kwargs.get('width', 0.12)  # TODO: auto detection

TODO found
Open

            # TODO: +- pi border
Severity: Minor
Found in KicadModTree/nodes/base/Arc.py by fixme

TODO found
Open

            print("TODO: add angle side: {1}".format(float_angle))
Severity: Minor
Found in KicadModTree/nodes/base/Arc.py by fixme

TODO found
Open

        parser.add_argument('-v', '--verbose', help='show some additional information', action='store_true')  # TODO
Severity: Minor
Found in KicadModTree/ModArgparser.py by fixme

TODO found
Open

        self.width = kwargs.get('width', 0.12)  # TODO: better variation to get line width

TODO found
Open

        # TODO: recursion detection
Severity: Minor
Found in KicadModTree/nodes/Node.py by fixme

TODO found
Open

        # TODO: finish implementation
Severity: Minor
Found in KicadModTree/nodes/base/Arc.py by fixme

TODO found
Open

from KicadModTree.nodes.base.Pad import Pad  # TODO: why .KicadModTree is not enough?
Severity: Minor
Found in KicadModTree/KicadFileHandler.py by fixme

TODO found
Open

                # TODO: most of the points are 2D Nodes
Severity: Minor
Found in KicadModTree/nodes/Node.py by fixme

TODO found
Open

# TODO: sort Text by type
Severity: Minor
Found in KicadModTree/nodes/Footprint.py by fixme
Severity
Category
Status
Source
Language