Skip to content

Commit 7abdc03

Browse files
authored
Merge pull request #193 from nicolasbock/indent_fix
Fix indent script
2 parents aa50e51 + d58a4d7 commit 7abdc03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+7377
-7331
lines changed

.github/workflows/CI.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ env:
2929
VERBOSE_MAKEFILE: yes
3030

3131
jobs:
32+
lint:
33+
name: Lint sources
34+
runs-on: ubuntu-18.04
35+
steps:
36+
- name: Check out sources
37+
uses: actions/checkout@v1
38+
- name: Prepare container
39+
run: ./prepare-container.sh
40+
- run: bundle install
41+
- run: bundle exec danger || true
42+
- run: BML_OPENMP=no EMACS=emacs27 ./build.sh check_indent
43+
3244
build:
3345
name: Build and test (${{ matrix.JOBNAME }})
3446
runs-on: ubuntu-18.04

Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
source "https://rubygems.org"
3+
4+
gem "danger", "<8"
5+
gem "danger-commit_lint"
6+
gem "danger-mention"
7+
gem "danger-prose"
8+
gem "danger-welcome_message"
9+
gem "faraday", "<1.1.0"

build.sh

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ Usage:
1515
This script can be used to build and test the progress library. The script has to
1616
be given a command. Known commands are:
1717
18-
create - Create the build and install directories ('build' and 'install')
19-
configure - Configure the build system
20-
compile - Compile the sources
21-
install - Install the compiled sources
22-
testing - Run the test suite
23-
docs - Generate the API documentation
24-
indent - Indent the sources
25-
dist - Generate a tar file (this only works with git)
18+
create - Create the build and install directories ('build' and 'install')
19+
configure - Configure the build system
20+
compile - Compile the sources
21+
install - Install the compiled sources
22+
testing - Run the test suite
23+
docs - Generate the API documentation
24+
indent - Indent the sources
25+
check_indent - Check the indentation of the sources
26+
dist - Generate a tar file (this only works with git)
2627
2728
The following environment variables can be set to influence the configuration
2829
step and the build:
@@ -155,11 +156,16 @@ testing() {
155156
}
156157

157158
indent() {
158-
cd "${BUILD_DIR}"
159-
"${TOP_DIR}/indent.sh" 2>&1 | tee -a "${LOG_FILE}"
159+
cd "${TOP_DIR}"
160+
"${TOP_DIR}/indent.sh" 2>&1 | tee --append "${LOG_FILE}"
160161
check_pipe_error
162+
}
163+
164+
check_indent() {
161165
cd "${TOP_DIR}"
162-
git diff 2>&1 | tee -a "${LOG_FILE}"
166+
"${TOP_DIR}/indent.sh" 2>&1 | tee --append "${LOG_FILE}"
167+
check_pipe_error
168+
git diff 2>&1 | tee --append "${LOG_FILE}"
163169
check_pipe_error
164170
LINES=$(git diff | wc -l)
165171
if test ${LINES} -gt 0; then
@@ -211,9 +217,12 @@ if [[ $# -gt 0 ]]; then
211217
testing
212218
;;
213219
"indent")
214-
create
215220
indent
216221
;;
222+
"check_indent")
223+
create
224+
check_indent
225+
;;
217226
"dist")
218227
create
219228
configure

0 commit comments

Comments
 (0)