Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore Lints in the Bison/Flex Generated Files #3282

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cpp/src/IceGrid/Grammar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
#line 1 "src/IceGrid/Grammar.y"


//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
// Copyright (c) ZeroC, Inc.

// NOLINTBEGIN


#line 76 "src/IceGrid/Grammar.cpp"
Expand Down Expand Up @@ -3325,3 +3325,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
return yyresult;
}

#line 810 "src/IceGrid/Grammar.y"


// NOLINTEND
10 changes: 7 additions & 3 deletions cpp/src/IceGrid/Grammar.y
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%code top{

//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
// Copyright (c) ZeroC, Inc.

// NOLINTBEGIN

}

Expand Down Expand Up @@ -806,3 +806,7 @@ keyword
{
}
;

%%

// NOLINTEND
20 changes: 11 additions & 9 deletions cpp/src/IceGrid/Scanner.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#line 1 "src/IceGrid/Scanner.cpp"
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
#line 2 "src/IceGrid/Scanner.cpp"
// Copyright (c) ZeroC, Inc.

#include "../Ice/ScannerConfig.h"
#include <cstdint>

#line 9 "src/IceGrid/Scanner.cpp"
// NOLINTBEGIN

#line 10 "src/IceGrid/Scanner.cpp"

#define YY_INT_ALIGNED long int

Expand Down Expand Up @@ -497,7 +497,7 @@ namespace IceGrid
#define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize)
#define YY_FATAL_ERROR(msg) fatalError(msg);

#line 500 "src/IceGrid/Scanner.cpp"
#line 501 "src/IceGrid/Scanner.cpp"
#line 42 "src/IceGrid/Scanner.l"
/* Instructs flex to not suppress any warnings when generating the scanner. */
/* By default flex will 'default match' any text it encounters that doesn't match any specified rules. This
Expand All @@ -510,7 +510,7 @@ namespace IceGrid
/* Directs flex to store matched text as 'char *' instead of char arrays, for improved performance. */
/* We always want the scanner to run in interactive mode. */
/* Disables the generation of functions we don't use to reduce clutter, and possibly improve performance. */
#line 513 "src/IceGrid/Scanner.cpp"
#line 514 "src/IceGrid/Scanner.cpp"

#define INITIAL 0

Expand Down Expand Up @@ -714,7 +714,7 @@ YY_DECL
#line 73 "src/IceGrid/Scanner.l"


#line 717 "src/IceGrid/Scanner.cpp"
#line 718 "src/IceGrid/Scanner.cpp"

while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
Expand Down Expand Up @@ -918,7 +918,7 @@ YY_RULE_SETUP
#line 194 "src/IceGrid/Scanner.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 921 "src/IceGrid/Scanner.cpp"
#line 922 "src/IceGrid/Scanner.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();

Expand Down Expand Up @@ -1766,6 +1766,8 @@ void yyfree (void * ptr )
#line 194 "src/IceGrid/Scanner.l"


// NOLINTEND

namespace IceGrid
{
// This function is always called once, right before scanning begins.
Expand Down
8 changes: 5 additions & 3 deletions cpp/src/IceGrid/Scanner.l
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%top{
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
// Copyright (c) ZeroC, Inc.

#include "../Ice/ScannerConfig.h"
#include <cstdint>

// NOLINTBEGIN

}

%{
Expand Down Expand Up @@ -192,6 +192,8 @@ keyword [[:alpha:]]*

%%

// NOLINTEND

namespace IceGrid
{
// This function is always called once, right before scanning begins.
Expand Down
8 changes: 5 additions & 3 deletions cpp/src/IceStorm/Grammar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
#line 1 "src/IceStorm/Grammar.y"


//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
// Copyright (c) ZeroC, Inc.

// NOLINTBEGIN


#line 76 "src/IceStorm/Grammar.cpp"
Expand Down Expand Up @@ -1585,3 +1585,5 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);

#line 226 "src/IceStorm/Grammar.y"


// NOLINTEND
8 changes: 5 additions & 3 deletions cpp/src/IceStorm/Grammar.y
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%code top{

//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
// Copyright (c) ZeroC, Inc.

// NOLINTBEGIN

}

Expand Down Expand Up @@ -224,3 +224,5 @@ keyword
}

%%

// NOLINTEND
20 changes: 11 additions & 9 deletions cpp/src/IceStorm/Scanner.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#line 1 "src/IceStorm/Scanner.cpp"
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
#line 2 "src/IceStorm/Scanner.cpp"
// Copyright (c) ZeroC, Inc.

#include "../Ice/ScannerConfig.h"
#include <cstdint>

#line 9 "src/IceStorm/Scanner.cpp"
// NOLINTBEGIN

#line 10 "src/IceStorm/Scanner.cpp"

#define YY_INT_ALIGNED long int

Expand Down Expand Up @@ -495,7 +495,7 @@ namespace IceStorm
#define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize)
#define YY_FATAL_ERROR(msg) fatalError(msg);

#line 498 "src/IceStorm/Scanner.cpp"
#line 499 "src/IceStorm/Scanner.cpp"
#line 40 "src/IceStorm/Scanner.l"
/* Instructs flex to not suppress any warnings when generating the scanner. */
/* By default flex will 'default match' any text it encounters that doesn't match any specified rules. This
Expand All @@ -508,7 +508,7 @@ namespace IceStorm
/* Directs flex to store matched text as 'char *' instead of char arrays, for improved performance. */
/* We always want the scanner to run in interactive mode. */
/* Disables the generation of functions we don't use to reduce clutter, and possibly improve performance. */
#line 511 "src/IceStorm/Scanner.cpp"
#line 512 "src/IceStorm/Scanner.cpp"

#define INITIAL 0

Expand Down Expand Up @@ -712,7 +712,7 @@ YY_DECL
#line 71 "src/IceStorm/Scanner.l"


#line 715 "src/IceStorm/Scanner.cpp"
#line 716 "src/IceStorm/Scanner.cpp"

while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
Expand Down Expand Up @@ -943,7 +943,7 @@ YY_RULE_SETUP
#line 219 "src/IceStorm/Scanner.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 946 "src/IceStorm/Scanner.cpp"
#line 947 "src/IceStorm/Scanner.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();

Expand Down Expand Up @@ -1791,6 +1791,8 @@ void yyfree (void * ptr )
#line 219 "src/IceStorm/Scanner.l"


// NOLINTEND

namespace IceStorm
{
// This function is always called once, right before scanning begins.
Expand Down
8 changes: 5 additions & 3 deletions cpp/src/IceStorm/Scanner.l
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%top{
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
// Copyright (c) ZeroC, Inc.

#include "../Ice/ScannerConfig.h"
#include <cstdint>

// NOLINTBEGIN

}

%{
Expand Down Expand Up @@ -217,6 +217,8 @@ keyword [[:alpha:]]*

%%

// NOLINTEND
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't put it at the very end because you expect the code below to be lint-free?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all the code under this line is our code, copied verbatim into the generated file.

I don't expect it to be lint free (but maybe it is). But since it's our code, these are lints that we should be fixing, and not just ignoring!


namespace IceStorm
{
// This function is always called once, right before scanning begins.
Expand Down
Loading
Loading