GitHub Action to lint C and C++ code (#156)
* GitHub Action to lint C and C++ code GitHub Action to run cpplint recursively on all pushes and pull requests https://github.com/cpplint/GitHub-Action-for-cpplint * Update cpplint.yml * Update cpplint.yml * Update cpplint.yml * Fix import order Found C system header after C++ system header. Should be: doubly.h, c system, c++ system, other. [build/include_order] [4] * Fix import order * Update string-tokeniser.cpppull/168/head
parent
0459f08eeb
commit
d7860a161e
|
@ -0,0 +1,13 @@
|
|||
# GitHub Action to run cpplint recursively on all pushes and pull requests
|
||||
# https://github.com/cpplint/GitHub-Action-for-cpplint
|
||||
|
||||
name: cpplint
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
cpplint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- run: pip install cpplint
|
||||
- run: cpplint --counting=detailed --filter=-build/namespaces,-legal,-readability,-runtime,-whitespace --recursive .
|
|
@ -1,36 +1,36 @@
|
|||
#include <bits/stdc++.h>
|
||||
#include <iostream>
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
struct Node {
|
||||
int data;
|
||||
struct Node *prev;
|
||||
struct Node *next;
|
||||
int data;
|
||||
struct Node *prev;
|
||||
struct Node *next;
|
||||
};
|
||||
struct Node* head = NULL;
|
||||
void insert(int newdata) {
|
||||
struct Node* newnode = (struct Node*) malloc(sizeof(struct Node));
|
||||
newnode->data = newdata;
|
||||
newnode->prev = NULL;
|
||||
newnode->next = head;
|
||||
if(head != NULL)
|
||||
head->prev = newnode ;
|
||||
head = newnode;
|
||||
struct Node* newnode = (struct Node*) malloc(sizeof(struct Node));
|
||||
newnode->data = newdata;
|
||||
newnode->prev = NULL;
|
||||
newnode->next = head;
|
||||
if(head != NULL)
|
||||
head->prev = newnode ;
|
||||
head = newnode;
|
||||
}
|
||||
void display() {
|
||||
struct Node* ptr;
|
||||
ptr = head;
|
||||
while(ptr != NULL) {
|
||||
cout<< ptr->data <<" ";
|
||||
ptr = ptr->next;
|
||||
}
|
||||
struct Node* ptr;
|
||||
ptr = head;
|
||||
while(ptr != NULL) {
|
||||
cout<< ptr->data <<" ";
|
||||
ptr = ptr->next;
|
||||
}
|
||||
}
|
||||
int main() {
|
||||
insert(3);
|
||||
insert(1);
|
||||
insert(7);
|
||||
insert(2);
|
||||
insert(9);
|
||||
cout<<"The doubly linked list is: ";
|
||||
display();
|
||||
return 0;
|
||||
insert(3);
|
||||
insert(1);
|
||||
insert(7);
|
||||
insert(2);
|
||||
insert(9);
|
||||
cout<<"The doubly linked list is: ";
|
||||
display();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <math.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <math.h>
|
||||
using namespace std;
|
||||
|
||||
int equalize_strings(string &x, string &y) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
#include <chrono>
|
||||
#include <chrono> // NOLINT [build/c++11]
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
Loading…
Reference in New Issue