-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from smithlabcode/linting
Linting and formatting code
- Loading branch information
Showing
13 changed files
with
1,025 additions
and
971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This file is part of preseq | ||
# | ||
# Copyright (C) 2024: Andrew D. Smith | ||
# | ||
# Authors: Andrew D. Smith | ||
# | ||
# This is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This software is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
|
||
BasedOnStyle: LLVM | ||
ColumnLimit: 80 | ||
IndentWidth: 2 | ||
AlwaysBreakAfterReturnType: TopLevel | ||
ContinuationIndentWidth: 2 | ||
ConstructorInitializerIndentWidth: 2 | ||
BraceWrapping: | ||
BeforeElse: true | ||
BeforeCatch: true | ||
BreakBeforeBraces: Custom | ||
BreakConstructorInitializers: AfterColon | ||
SpacesBeforeTrailingComments: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This file is part of preseq | ||
# | ||
# Copyright (C) 2024: Andrew D. Smith | ||
# | ||
# Authors: Andrew D. Smith | ||
# | ||
# This is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This software is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
|
||
name: Source formatting with clang-format | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
clang-format: | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get install -y clang-format | ||
|
||
- name: Run clang-format | ||
run: | | ||
clang-format --dry-run -Werror $(git ls-files '*.*pp') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This file is part of preseq | ||
# | ||
# Copyright (C) 2024: Andrew D. Smith | ||
# | ||
# Authors: Andrew D. Smith | ||
# | ||
# This is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This software is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
|
||
name: Linting with cpplint | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
cpplint: | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
matrix: | ||
python-version: ["3.12"] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Python setup ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install cpplint | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install cpplint | ||
- name: Check cpplint version | ||
run: cpplint --version | ||
|
||
- name: Run cpplint | ||
run: | | ||
cpplint --quiet --repository=. $(git ls-files '*.*pp') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This file is part of preseq | ||
# | ||
# Copyright (C) 2024: Andrew D. Smith | ||
# | ||
# Authors: Andrew D. Smith | ||
# | ||
# This is free software: you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This software is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# General Public License for more details. | ||
|
||
set noparent | ||
filter=-runtime/references | ||
filter=-build/include_subdir | ||
filter=-build/include_order | ||
filter=-build/c++11 | ||
filter=-build/c++17 | ||
# Formatting below handled by clang-format | ||
filter=-whitespace/line_length | ||
filter=-whitespace/newline | ||
filter=-readability/braces | ||
filter=-whitespace/semicolon | ||
filter=-whitespace/indent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
# | ||
# Run 'autoreconf -i' to generate 'configure', 'Makefile.in', etc. | ||
# | ||
# The first time this is run on a new cloned git repo the configure | ||
# script will not be present, only the configure.ac and | ||
# Makefile.am. The rest must be generated by `autoreconf -i`. | ||
# | ||
# If you are working with a distribution (file ending with ".tar.gz" | ||
# or similar) then this script should not be needed, and should not be | ||
# present, as all the files should already exist. You should only run | ||
# this script if you know what you are doing with autoreconf. | ||
# | ||
# This script will only work with an argument to confirm the help | ||
# message has been read. | ||
|
||
runautoreconf() { | ||
autoreconf -i; | ||
} | ||
|
||
if test -d .git && test "$(basename "${PWD}")" = "preseq" | ||
then | ||
runautoreconf | ||
exit 0 | ||
else | ||
echo " It seems you are either attempting to run this script " | ||
echo " from the wrong directory, or in a source tree that was " | ||
echo " not obtained by cloning the preseq git repo. " | ||
echo " " | ||
echo " ./autogen.sh generates the configure script. Only run " | ||
echo " " | ||
echo " Only run this if you know what you are doing with " | ||
echo " autoreconf and are simply avoiding doing that. If you " | ||
echo " just want to use the software, download a release and " | ||
echo " this script will not be needed. " | ||
exit 1 | ||
fi |
Oops, something went wrong.