__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A super simple linter to check C syntax."""
from __future__ import print_function
import argparse
import sys
warned = False
def warn(path, line, lineno, msg):
global warned
warned = True
print("%s:%s: %s" % (path, lineno, msg), file=sys.stderr)
def check_line(path, line, idx, lines):
s = line
lineno = idx + 1
eof = lineno == len(lines)
if s.endswith(' \n'):
warn(path, line, lineno, "extra space at EOL")
elif '\t' in line:
warn(path, line, lineno, "line has a tab")
elif s.endswith('\r\n'):
warn(path, line, lineno, "Windows line ending")
# end of global block, e.g. "}newfunction...":
elif s == "}\n":
if not eof:
nextline = lines[idx + 1]
# "#" is a pre-processor line
if (
nextline != '\n'
and nextline.strip()[0] != '#'
and nextline.strip()[:2] != '*/'
):
warn(path, line, lineno, "expected 1 blank line")
sls = s.lstrip()
if sls.startswith('//') and sls[2] != ' ' and line.strip() != '//':
warn(path, line, lineno, "no space after // comment")
# e.g. "if(..." after keywords
keywords = ("if", "else", "while", "do", "enum", "for")
for kw in keywords:
if sls.startswith(kw + '('):
warn(path, line, lineno, "missing space between %r and '('" % kw)
# eof
if eof and not line.endswith('\n'):
warn(path, line, lineno, "no blank line at EOF")
ss = s.strip()
if ss.startswith(("printf(", "printf (")):
if not ss.endswith(("// NOQA", "// NOQA")):
warn(path, line, lineno, "printf() statement")
def process(path):
with open(path) as f:
lines = f.readlines()
for idx, line in enumerate(lines):
check_line(path, line, idx, lines)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('paths', nargs='+', help='path(s) to a file(s)')
args = parser.parse_args()
for path in args.paths:
process(path)
if warned:
sys.exit(1)
if __name__ == '__main__':
main()
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| README | File | 105 B | 0644 |
|
| appveyor_run_with_compiler.cmd | File | 3.29 KB | 0644 |
|
| bench_oneshot.py | File | 3.26 KB | 0755 |
|
| bench_oneshot_2.py | File | 1.06 KB | 0755 |
|
| check_broken_links.py | File | 7.85 KB | 0755 |
|
| clinter.py | File | 2.26 KB | 0755 |
|
| convert_readme.py | File | 1.46 KB | 0755 |
|
| download_wheels_appveyor.py | File | 3.49 KB | 0755 |
|
| download_wheels_github.py | File | 2.95 KB | 0755 |
|
| generate_manifest.py | File | 884 B | 0755 |
|
| git_pre_commit.py | File | 4.54 KB | 0755 |
|
| print_access_denied.py | File | 3.21 KB | 0755 |
|
| print_announce.py | File | 3.22 KB | 0755 |
|
| print_api_speed.py | File | 6.56 KB | 0755 |
|
| print_dist.py | File | 3.58 KB | 0755 |
|
| print_downloads.py | File | 3.98 KB | 0755 |
|
| print_hashes.py | File | 1.1 KB | 0755 |
|
| print_timeline.py | File | 1.39 KB | 0755 |
|
| purge_installation.py | File | 1 KB | 0755 |
|
| winmake.py | File | 17.05 KB | 0755 |
|