Skip to content

Commit 5d2ea81

Browse files
* adding cpp * adding cpp * tests * make test better * fix test
1 parent 1a00fc3 commit 5d2ea81

File tree

12 files changed

+83
-925
lines changed

12 files changed

+83
-925
lines changed

.automation/test/cpp/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# CPP Test Cases
2+
3+
This folder holds the test cases for **CPP**.
4+
5+
## Additional Docs
6+
7+
No Additional information is needed for this test case.
8+
9+
## Good Test Cases
10+
11+
The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted.
12+
13+
- **Note:** They are linted utilizing the default linter rules.
14+
15+
## Bad Test Cases
16+
17+
The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted.
18+
19+
- **Note:** They are linted utilizing the default linter rules.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <iostream>
2+
#include <fstream>
3+
using namespace std;
4+
5+
int main() {
6+
// Create and open a text file
7+
ofstream MyFile("filename.txt");
8+
9+
// Write to the file
10+
MyFile << "Files can be tricky, but it is fun enough!";
11+
12+
// Close the file
13+
//MyFile.close();
14+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2021 GitHub
2+
3+
#include <iostream>
4+
#include <fstream>
5+
using std::string;
6+
7+
int main() {
8+
// Create and open a text file
9+
ofstream MyFile("filename.txt");
10+
11+
// Write to the file
12+
MyFile << "Files can be tricky, but it is fun enough!";
13+
14+
// Close the file
15+
MyFile.close();
16+
}

.github/workflows/deploy-DEV.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ jobs:
6666
--build-arg BUILD_DATE=${{ env.BUILD_DATE }} \
6767
--build-arg BUILD_REVISION=${{ github.sha }} \
6868
--build-arg BUILD_VERSION=${{ github.sha }} \
69-
-t ghcr.io/github/super-linter:${{ github.sha }} -f Dockerfile .
69+
-t ghcr.io/github/super-linter:${{ github.sha }} \
70+
-t ghcr.io/github/super-linter:test -f Dockerfile .
7071
7172
########################################
7273
# Validates the metadata docker labels #

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ inspec-check: ## Validate inspec profiles
7171
test/inspec/super-linter
7272

7373
SUPER_LINTER_TEST_CONTAINER_NAME := "super-linter-test"
74+
SUPER_LINTER_TEST_CONTINER_URL := "ghcr.io/github/super-linter:test"
7475

7576
.PHONY: inspec
7677
inspec: inspec-check ## Run InSpec tests
7778
DOCKER_CONTAINER_STATE="$$(docker inspect --format "{{.State.Running}}" "$(SUPER_LINTER_TEST_CONTAINER_NAME)" 2>/dev/null || echo "")"; \
7879
if [ "$$DOCKER_CONTAINER_STATE" = "true" ]; then docker kill "$(SUPER_LINTER_TEST_CONTAINER_NAME)"; fi && \
79-
SUPER_LINTER_TEST_CONTAINER_ID="$$(docker run -d --name "$(SUPER_LINTER_TEST_CONTAINER_NAME)" --rm -it --entrypoint /bin/ash ghcr.io/github/super-linter -c "while true; do sleep 1; done")" \
80+
docker build -t $(SUPER_LINTER_TEST_CONTAINER_NAME) -f Dockerfile . && \
81+
SUPER_LINTER_TEST_CONTAINER_ID="$$(docker run -d --name "$(SUPER_LINTER_TEST_CONTAINER_NAME)" --rm -it --entrypoint /bin/ash "$(SUPER_LINTER_TEST_CONTAINER_NAME)" -c "while true; do sleep 1; done")" \
8082
&& docker run $(DOCKER_FLAGS) \
8183
--rm \
8284
-v "$(CURDIR)":/workspace \

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their code base
5151
| **Ansible** | [ansible-lint](https://github.com/ansible/ansible-lint) |
5252
| **Azure Resource Manager (ARM)** | [arm-ttk](https://github.com/azure/arm-ttk) |
5353
| **AWS CloudFormation templates** | [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint/) |
54+
| **C++** | [cpp-lint](https://github.com/cpplint/cpplint) |
5455
| **C#** | [dotnet-format](https://github.com/dotnet/format) |
5556
| **CSS** | [stylelint](https://stylelint.io/) |
5657
| **Clojure** | [clj-kondo](https://github.com/borkdude/clj-kondo) |
@@ -251,6 +252,7 @@ But if you wish to select or exclude specific linters, we give you full control
251252
| **VALIDATE_ARM** | `true` | Flag to enable or disable the linting process of the ARM language. |
252253
| **VALIDATE_BASH** | `true` | Flag to enable or disable the linting process of the Bash language. |
253254
| **VALIDATE_BASH_EXEC** | `true` | Flag to enable or disable the linting process of the Bash language to validate if file is stored as executable. |
255+
| **VALIDATE_CPP** | `true` | Flag to enable or disable the linting process of the C++ language. |
254256
| **VALIDATE_CLOJURE** | `true` | Flag to enable or disable the linting process of the Clojure language. |
255257
| **VALIDATE_CLOUDFORMATION** | `true` | Flag to enable or disable the linting process of the AWS Cloud Formation language. |
256258
| **VALIDATE_COFFEESCRIPT** | `true` | Flag to enable or disable the linting process of the Coffeescript language. |

dependencies/Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ verify_ssl = true
99
ansible-lint = {extras = ["core"], version = "*"}
1010
black = "*"
1111
cfn-lint = "*"
12+
cpplint = "*"
1213
cython = "*"
1314
flake8 = "*"
1415
isort = "*"

dependencies/Pipfile.lock

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)