public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
* [PATCH olang v1] build: rename linter to format to avoid confusion
@ 2024-04-20 13:54 Johnny Richard
  2024-04-20 12:57 ` [olang/patches/.build.yml] build failed builds.sr.ht
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Johnny Richard @ 2024-04-20 13:54 UTC (permalink / raw)
  To: ~johnnyrichard/olang-devel; +Cc: Johnny Richard

We have been using linter as the target to check our code formatting.
Today we are using `clang-format` to verify the formatting.  This tool
does only formatting, and miss other features that a linter have.

Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
---
 .build.yml                 |  4 ++--
 Makefile                   | 16 ++++++++--------
 docs/pages/contribute.md   | 16 ++++++++--------
 tests/integration/Makefile |  8 ++++----
 tests/unit/Makefile        |  8 ++++----
 5 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/.build.yml b/.build.yml
index 72f0254..01f4aab 100644
--- a/.build.yml
+++ b/.build.yml
@@ -11,9 +11,9 @@ environment:
 sources:
   - https://git.sr.ht/~johnnyrichard/olang
 tasks:
-  - lint: |
+  - format: |
       cd olang
-      make linter
+      make format
   - build: |
       cd olang
       make
diff --git a/Makefile b/Makefile
index cdfc8e1..27337d4 100644
--- a/Makefile
+++ b/Makefile
@@ -16,17 +16,17 @@ $(TARGET): $(BUILD_DIR) $(OBJS)
 $(BUILD_DIR):
 	@mkdir -p $@
 
-.PHONY: linter
-linter: $(SRCS) $(HEADERS)
+.PHONY: format
+format: $(SRCS) $(HEADERS)
 	clang-format --dry-run --Werror $?
-	$(MAKE) -C tests/integration/ linter
-	$(MAKE) -C tests/unit/ linter
+	$(MAKE) -C tests/integration/ format
+	$(MAKE) -C tests/unit/ format
 
-.PHONY: linter-fix
-linter-fix: $(SRCS) $(HEADERS)
+.PHONY: format-fix
+format-fix: $(SRCS) $(HEADERS)
 	clang-format -i $?
-	$(MAKE) -C tests/integration/ linter-fix
-	$(MAKE) -C tests/unit/ linter-fix
+	$(MAKE) -C tests/integration/ format-fix
+	$(MAKE) -C tests/unit/ format-fix
 
 .PHONY: integration-test
 integration-test:
diff --git a/docs/pages/contribute.md b/docs/pages/contribute.md
index 884c4b4..a6dfd04 100644
--- a/docs/pages/contribute.md
+++ b/docs/pages/contribute.md
@@ -25,21 +25,21 @@ Code style
 
 Instead of delineating every element of our coding style, we have
 adopted the use of **clang-format** to enforce the olang code style.
-Please refer to the linter section below for guidance on its
+Please refer to the **Format** section below for guidance on its
 application.
 
-### Linter
+### Format
 
-Checking for linter issues:
+Checking for format issues:
 
 ``` {.sh}
-make linter
+make format
 ```
 
 Most of the common code style mistakes are fixed by:
 
 ``` {.sh}
-make linter-fix
+make format-fix
 ```
 
 ### .editorconfig
@@ -92,9 +92,9 @@ the email-driven workflow here, but you can check it out at
 1. Write single-purpose commits.
 2. Write a meaningful commit message.
 3. Every commit must be production ready.
-    - If the tests or the linter fail, you should not create a fix commit.
-      Instead, you should amend the commit that caused the issue and then
-      resend the patchset.
+    - If the tests or the format check fail, you should not create a fix
+      commit. Instead, you should amend the commit that caused the issue and
+      then resend the patchset.
 
 ### Step 2: Create your patch
 
diff --git a/tests/integration/Makefile b/tests/integration/Makefile
index db2b7d9..4625707 100644
--- a/tests/integration/Makefile
+++ b/tests/integration/Makefile
@@ -16,12 +16,12 @@ all: $(MUNIT) proc_exec.o cli_runner.o $(TESTS)
 clean:
 	$(RM) *.o *_test
 
-.PHONY: linter
-linter: $(SRCS)
+.PHONY: format
+format: $(SRCS)
 	clang-format --dry-run --Werror $?
 
-.PHONY: linter-fix
-linter-fix: $(SRCS)
+.PHONY: format-fix
+format-fix: $(SRCS)
 	clang-format -i $?
 
 cli_test: $(MUNIT) proc_exec.o cli_runner.o cli_test.o
diff --git a/tests/unit/Makefile b/tests/unit/Makefile
index 498bf98..783225c 100644
--- a/tests/unit/Makefile
+++ b/tests/unit/Makefile
@@ -18,12 +18,12 @@ clean:
 	$(RM) *.o *_test
 	$(RM) -rfv lib
 
-.PHONY: linter
-linter: $(SRCS)
+.PHONY: format
+format: $(SRCS)
 	clang-format --dry-run --Werror $?
 
-.PHONY: linter-fix
-linter-fix: $(SRCS)
+.PHONY: format-fix
+format-fix: $(SRCS)
 	clang-format -i $?
 
 %_test: $(MUNIT) $(SUBJECT_OBJS) %_test.c

base-commit: 36b028f712ff2402761ea307467860c346d3c0a0
-- 
2.44.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-19 23:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-20 13:54 [PATCH olang v1] build: rename linter to format to avoid confusion Johnny Richard
2024-04-20 12:57 ` [olang/patches/.build.yml] build failed builds.sr.ht
2024-08-16 22:32 ` [PATCH olang v1] build: rename linter to format to avoid confusion Johnny Richard
2024-08-19 23:23 ` Carlos Maniero

Code repositories for project(s) associated with this public inbox

	https://git.johnnyrichard.com/olang.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox