1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
|
[build-system]
build-backend = "setuptools.build_meta"
requires = [ "setuptools>=61.2" ]
[project]
name = "cpplint"
description = "Check C++ files configurably against Google's style guide"
readme = "README.rst"
keywords = [ "c++", "cpp", "google style", "lint" ]
license = { text = "BSD-3-Clause" }
maintainers = [
{ name = "Aaron Liu", email = "aaronliu0130@gmail.com" },
{ name = "Christian Clauss", email = "cclauss@me.com" },
{ name = "John Vandenberg", email = "jayvdb@gmail.com" },
]
authors = [
{ name = "Google Inc." },
{ name = "Thibault Kruse" },
{ name = "Andrew Davis", email = "theandrewdavis@gmail.com" },
{ name = "cpplint developers" },
]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"License :: Freely Distributable",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: C++",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Quality Assurance",
]
dynamic = [ "version" ]
dependencies = [ ]
optional-dependencies.dev = [
"mypy",
"pylint>=3.3.4",
"pytest",
"pytest-cov",
"pytest-timeout",
"testfixtures",
"tox<5",
]
urls.Homepage = "https://github.com/cpplint/cpplint"
scripts.cpplint = "cpplint:main"
[tool.setuptools]
py-modules = [ "cpplint" ]
include-package-data = false
dynamic.version = { attr = "cpplint.__VERSION__" }
[tool.ruff]
line-length = 100
lint.select = [
"A", # flake8-builtins
"AIR", # Airflow
"ASYNC", # flake8-async
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # McCabe cyclomatic complexity
"DJ", # flake8-django
"DTZ", # flake8-datetimez
"E", # pycodestyle
"EM", # flake8-errmsg
"EXE", # flake8-executable
"F", # Pyflakes
"FA", # flake8-future-annotations
"FAST", # FastAPI
"FBT", # flake8-boolean-trap
"FIX", # flake8-fixme
"FLY", # flynt
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"N", # pep8-naming
"NPY", # NumPy-specific rules
"PD", # pandas-vet
"PERF", # Perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # Pylint
"PT", # flake8-pytest-style
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"T10", # flake8-debugger
"TC", # flake8-type-checking
"TD", # flake8-todos
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
# "ANN", # flake8-annotations
# "ARG", # flake8-unused-arguments
# "COM", # flake8-commas
# "CPY", # flake8-copyright
# "D", # pydocstyle
# "DOC", # pydoclint
# "ERA", # eradicate
# "PTH", # flake8-use-pathlib
# "RUF", # Ruff-specific rules
# "S", # flake8-bandit
# "SLF", # flake8-self
# "T20", # flake8-print
]
lint.ignore = [
"FBT003", # flake8-boolean-trap
"FIX002", # flake8-fixme
"ISC003", # flake8-implicit-str-concat
"PIE790", # Unnecessary `pass` statement
"TD003", # flake8-todos
]
lint.per-file-ignores."cpplint.py" = [
"ICN001",
"N802",
"PERF401",
"PLR5501",
"PLW0603",
"PLW2901",
"SIM102",
"SIM108",
]
lint.per-file-ignores."cpplint_unittest.py" = [ "FLY002", "N802", "PLW0604", "SIM115", "UP031" ]
lint.mccabe.max-complexity = 29
lint.pylint.allow-magic-value-types = [ "bytes", "int", "str" ]
lint.pylint.max-args = 10 # Default is 5
lint.pylint.max-bool-expr = 8 # Default is 5
lint.pylint.max-branches = 30 # Default is 12
lint.pylint.max-locals = 16 # Default is 15
lint.pylint.max-public-methods = 130 # Default is 20
lint.pylint.max-returns = 9 # Default is 9
lint.pylint.max-statements = 79 # Default is 50
[tool.pylint.basic]
argument-rgx = "[a-z_][a-z0-9_]{0,49}$"
class-rgx = "[A-Z_][a-zA-Z0-9]+$"
const-rgx = "[a-zA-Z_][A-Za-z0-9_]{2,49}$"
function-rgx = "[A-Z_][A-Za-z0-9]{2,49}$|main"
include-naming-hint = true
method-rgx = "[A-Z_][A-Za-z0-9]{2,49}$|__init__|__str__|__contains__"
variable-rgx = "[a-z_][a-z0-9_]{0,49}$"
[tool.pylint.messages-control]
disable = [
"anomalous-unicode-escape-in-string",
"bad-continuation",
"bad-option-value",
"consider-merging-isinstance",
"consider-using-dict-comprehension",
"consider-using-in",
"consider-using-min-builtin",
"fixme",
"global-statement",
"missing-docstring",
"multiple-statements",
"no-else-return",
"no-self-use",
"too-many-positional-arguments",
"unnecessary-pass",
"unused-argument",
"useless-object-inheritance",
]
[tool.pylint.reports]
output-format = "colorized"
reports = false
score = false
[tool.pylint.format]
indent-after-paren = 4
indent-string = ' '
max-module-lines = 10000
[tool.pylint.design]
max-args = 20
max-attributes = 10
max-bool-expr = 10
max-branches = 30
max-line-length = 100
max-locals = 25
max-returns = 10
max-statements = 79
min-public-methods = 0
[tool.pytest.ini_options]
# fail if coverage is under 90%
addopts = "--color=yes --cov=cpplint"
python_files = [ "*test.py" ]
required_plugins = [ "pytest-cov", "pytest-timeout" ]
testpaths = [ "." ]
timeout = 481
|