mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11449 from ethereum/checkNamespaceStyle
Check for style of namespace.
This commit is contained in:
commit
2f0df8f054
@ -62,7 +62,8 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace solidity::langutil {
|
namespace solidity::langutil
|
||||||
|
{
|
||||||
|
|
||||||
string to_string(ScannerError _errorCode)
|
string to_string(ScannerError _errorCode)
|
||||||
{
|
{
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace solidity::frontend {
|
namespace solidity::frontend
|
||||||
|
{
|
||||||
|
|
||||||
/** Helper class that builds the control flow of a function or modifier.
|
/** Helper class that builds the control flow of a function or modifier.
|
||||||
* Modifiers are not yet applied to the functions. This is done in a second
|
* Modifiers are not yet applied to the functions. This is done in a second
|
||||||
|
@ -31,7 +31,8 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
namespace solidity::frontend {
|
namespace solidity::frontend
|
||||||
|
{
|
||||||
|
|
||||||
class Compiler
|
class Compiler
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,8 @@
|
|||||||
#include <queue>
|
#include <queue>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace solidity::frontend {
|
namespace solidity::frontend
|
||||||
|
{
|
||||||
|
|
||||||
class Compiler;
|
class Compiler;
|
||||||
|
|
||||||
|
@ -29,7 +29,8 @@
|
|||||||
#include <libsolidity/codegen/CompilerContext.h>
|
#include <libsolidity/codegen/CompilerContext.h>
|
||||||
#include <libsolidity/codegen/CompilerContext.h>
|
#include <libsolidity/codegen/CompilerContext.h>
|
||||||
|
|
||||||
namespace solidity::frontend {
|
namespace solidity::frontend
|
||||||
|
{
|
||||||
|
|
||||||
class Type; // forward
|
class Type; // forward
|
||||||
|
|
||||||
|
@ -39,7 +39,8 @@ namespace solidity::evmasm
|
|||||||
class AssemblyItem; // forward
|
class AssemblyItem; // forward
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace solidity::frontend {
|
namespace solidity::frontend
|
||||||
|
{
|
||||||
|
|
||||||
// forward declarations
|
// forward declarations
|
||||||
class CompilerContext;
|
class CompilerContext;
|
||||||
|
@ -27,7 +27,8 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace solidity::util {
|
namespace solidity::util
|
||||||
|
{
|
||||||
|
|
||||||
/// Removes members with null value recursively from (@a _json).
|
/// Removes members with null value recursively from (@a _json).
|
||||||
Json::Value removeNullMembers(Json::Value _json);
|
Json::Value removeNullMembers(Json::Value _json);
|
||||||
|
@ -40,7 +40,8 @@ using namespace solidity::util;
|
|||||||
using namespace solidity::langutil;
|
using namespace solidity::langutil;
|
||||||
using namespace solidity::yul;
|
using namespace solidity::yul;
|
||||||
|
|
||||||
namespace {
|
namespace
|
||||||
|
{
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
shared_ptr<DebugData const> updateLocationEndFrom(
|
shared_ptr<DebugData const> updateLocationEndFrom(
|
||||||
|
@ -28,7 +28,8 @@ using namespace solidity::yul;
|
|||||||
|
|
||||||
using OptionalStatements = std::optional<vector<Statement>>;
|
using OptionalStatements = std::optional<vector<Statement>>;
|
||||||
|
|
||||||
namespace {
|
namespace
|
||||||
|
{
|
||||||
|
|
||||||
OptionalStatements replaceConstArgSwitch(Switch& _switchStmt, u256 const& _constExprVal)
|
OptionalStatements replaceConstArgSwitch(Switch& _switchStmt, u256 const& _constExprVal)
|
||||||
{
|
{
|
||||||
|
@ -47,6 +47,7 @@ FORMATERROR=$(
|
|||||||
preparedGrep "\<(if|for|while|switch)\(" # no space after "if", "for", "while" or "switch"
|
preparedGrep "\<(if|for|while|switch)\(" # no space after "if", "for", "while" or "switch"
|
||||||
preparedGrep "\<for\>\s*\([^=]*\>\s:\s.*\)" # no space before range based for-loop
|
preparedGrep "\<for\>\s*\([^=]*\>\s:\s.*\)" # no space before range based for-loop
|
||||||
preparedGrep "\<if\>\s*\(.*\)\s*\{\s*$" # "{\n" on same line as "if"
|
preparedGrep "\<if\>\s*\(.*\)\s*\{\s*$" # "{\n" on same line as "if"
|
||||||
|
preparedGrep "namespace .*\{"
|
||||||
preparedGrep "[,\(<]\s*const " # const on left side of type
|
preparedGrep "[,\(<]\s*const " # const on left side of type
|
||||||
preparedGrep "^\s*(static)?\s*const " # const on left side of type (beginning of line)
|
preparedGrep "^\s*(static)?\s*const " # const on left side of type (beginning of line)
|
||||||
preparedGrep "^ [^*]|[^*] | [^*]" # uses spaces for indentation or mixes spaces and tabs
|
preparedGrep "^ [^*]|[^*] | [^*]" # uses spaces for indentation or mixes spaces and tabs
|
||||||
|
Loading…
Reference in New Issue
Block a user