AtomLinter / linter-cpplint

Linter plugin for c++, using cpplint
https://atom.io/packages/linter-cpplint
MIT License
6 stars 5 forks source link

- new linter api. #23

Closed imironhead closed 9 years ago

imironhead commented 9 years ago

Use new AtomLinter API.

steelbrain commented 9 years ago

Looks good, I'll test it soon and confirm that it works

keplersj commented 9 years ago

@steelbrain If you need a file to test against, this file from linter-clang unit tests should work.

steelbrain commented 9 years ago

@k2b6s9j mind testing it for me?

keplersj commented 9 years ago

@steelbrain Dev environment down for the night. Won't be able until, maybe, tomorrow afternoon.

keplersj commented 9 years ago

@steelbrain Use this file. It's a more official one provided by Google themselves.

imironhead commented 9 years ago

This is my test codes:

#include <iostream>

using namespace std;

// ==============================================================================

int main() {
  return 0 ;
}

A file xxx.cpp with this code should generate 4 warnings:


// Copyright 2015 Hello
#include <iostream>

using std::cout;

// =============================================================================

int main() {
  return 0;
}

This code generates no warnings.

imironhead commented 9 years ago

@k2b6s9j, @steelbrain cpplint_test_header.h is used in cpplint_unittest.py to test if cpplint generate warnings about header guard. cpplint.py should give 2 warnings: one for lack of copyright, the other for header guard.

The origin linter-cpplint lint only cpp files, and *.h in Atom is c* file (I guess, just like the keyword 'class' in .h is not highlighted). So file name cpplint_test_header.h** won't give any warning in linter-cpplint.

crucialfelix commented 9 years ago

Waiting patiently. cpp-linter does not work at all right now and doesn't post any errors or indicate anything.

it would be nice if atom-linter could have detected that the API is not compliant and posted a warning.

claims to work:

active linter-cpplint

steelbrain commented 9 years ago

@crucialfelix it does post the warning. But atom folks decided to show that kinda warnings in dev mode only :(

crucialfelix commented 9 years ago

:( indeed. they should at least post to the console. I hate silent failure more than anything.

thanks for the package !

keplersj commented 9 years ago

I'll merge this in hopes that it is working. If it is not, we'll have to work from there.

crucialfelix commented 9 years ago

considering it didn't work at all, and now it might work - that's an entirely reasonable gamble. thanks !