Skip to content

Update to use the Google shell styleguide #268

Description

@evelikov

Due to its age (et al) dkms has various styles mixed in. Most prominently - it does not use safe(r) bash constructs line [[ and ((, set -euo pipefail, while in other cases the code is borderline bonkers.

Please keep changes separated logically and do not clump everything into a mega-commit or two.

Ideally we'll also get a CI stage/action that ensures these are consistent, somewhat at least. Can be done alongside the proposed shellcheck #267 or via other means.

Activity

  1. siddhpant commented on Oct 27, 2022

    @siddhpant

    Maybe the Linux kernel style (like using tabs etc.) should be followed since this is something related to it?

    Also, maybe the huge bash script could be split into multiple files for modularity... 80 char limitation will make the script code longer, so if the file is split, reading might become easier. Bash's source can "import" functions from other files.

  2. evelikov commented on Oct 27, 2022

    @evelikov
    CollaboratorAuthor

    I don't understand what you mean - kernel is written in C, so their styleguide follows that, while dkms is in shell/bash. Sounds like trying to push a square peg through a round hole, with this suggestion.

    Yes, dkms is big, but chunking it into smaller pieces mostly increases the odds of breaking things. Not unless we get an order of magnitude more tests. Nevertheless - that's not the concern raised here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions