Skip to content

Testing: add GitHub action to check all lines are <= 80 characters#126

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
cconlon:ghActionLineLength
Jul 14, 2025
Merged

Testing: add GitHub action to check all lines are <= 80 characters#126
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
cconlon:ghActionLineLength

Conversation

@cconlon
Copy link
Member

@cconlon cconlon commented Jul 11, 2025

This PR adds a GitHub action that checks to make sure all added lines are <= 80 characters, to match internal coding standards.

  • Only checks ./src, ./examples, and ./jni directories
  • Prints out all occurrences of long lines found to actions log

Example of a failure run: https://github.com/wolfSSL/wolfcrypt-jni/actions/runs/16231643997/job/45835457598?pr=126

@cconlon cconlon self-assigned this Jul 11, 2025
@cconlon cconlon force-pushed the ghActionLineLength branch 4 times, most recently from 0afe2d9 to ccd3793 Compare July 11, 2025 21:10
@cconlon cconlon requested a review from Copilot July 11, 2025 21:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a GitHub Actions workflow that enforces an 80-character maximum on newly added lines in src/, examples/, and jni/ directories.

  • Introduces .github/workflows/line-length-check.yml to run on all pull requests
  • Scans only changed files under the target directories and fails if any added line exceeds 80 characters
Comments suppressed due to low confidence (3)

.github/workflows/line-length-check.yml:33

  • [nitpick] Consider using mktemp to generate unique temporary filenames instead of fixed names (violations.tmp and changed_files.txt) to avoid collisions and streamline cleanup.
        echo > violations.tmp

.github/workflows/line-length-check.yml:41

  • [nitpick] You can simplify the two-step grep filter by matching only added lines that don't start with multiple pluses: e.g., grep -E '^+[^+]' to avoid the separate grep -v '^+++'.
            git diff "origin/$BASE_BRANCH"...HEAD "$file" | \

.github/workflows/line-length-check.yml:49

  • Include the offending line number in the output (e.g., using grep -n) so developers can directly locate and fix the long line without running additional commands.
                  echo "❌ $file - Line too long ($char_count characters)"

@cconlon cconlon force-pushed the ghActionLineLength branch from ccd3793 to 25bca96 Compare July 11, 2025 23:31
@cconlon cconlon force-pushed the ghActionLineLength branch from 25bca96 to 1bb3016 Compare July 11, 2025 23:33
@JacobBarthelmeh JacobBarthelmeh merged commit 0f5de75 into wolfSSL:master Jul 14, 2025
112 of 117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants