mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
lint
This commit is contained in:
parent
6f51c1774d
commit
9315adb8c5
5 changed files with 32 additions and 37 deletions
|
@ -4,7 +4,7 @@ import("//v8/snapshot_toolchain.gni")
|
|||
import("deno.gni")
|
||||
|
||||
config("deno_config") {
|
||||
include_dirs = [ "v8" ] # This allows us to v8/src/base/ libraries.
|
||||
include_dirs = [ "v8" ] # This allows us to v8/src/base/ libraries.
|
||||
configs = [ "v8:external_config" ]
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ function assert(cond) {
|
|||
if (!cond) throw Error("mock_runtime.js assert failed");
|
||||
}
|
||||
|
||||
global.typedArrayToArrayBuffer = (ta) => {
|
||||
global.typedArrayToArrayBuffer = ta => {
|
||||
return ta.buffer.slice(ta.byteOffset, ta.byteOffset + ta.byteLength);
|
||||
};
|
||||
|
||||
|
|
|
@ -27,28 +27,22 @@ assert os.path.exists(pbts_bin)
|
|||
proto_in = sys.argv[1]
|
||||
stamp_file = sys.argv[2]
|
||||
|
||||
|
||||
def touch(fname):
|
||||
if os.path.exists(fname):
|
||||
os.utime(fname, None)
|
||||
else:
|
||||
open(fname, 'a').close()
|
||||
if os.path.exists(fname):
|
||||
os.utime(fname, None)
|
||||
else:
|
||||
open(fname, 'a').close()
|
||||
|
||||
|
||||
subprocess.check_call([
|
||||
"node",
|
||||
pbjs_bin,
|
||||
"--target=static-module",
|
||||
"--wrapper=commonjs",
|
||||
"--out=" + msg_pbjs_out,
|
||||
proto_in
|
||||
"node", pbjs_bin, "--target=static-module", "--wrapper=commonjs",
|
||||
"--out=" + msg_pbjs_out, proto_in
|
||||
])
|
||||
assert os.path.exists(msg_pbjs_out)
|
||||
|
||||
subprocess.check_call([
|
||||
"node",
|
||||
pbts_bin,
|
||||
"--out=" + msg_pbts_out,
|
||||
msg_pbjs_out
|
||||
])
|
||||
subprocess.check_call(
|
||||
["node", pbts_bin, "--out=" + msg_pbts_out, msg_pbjs_out])
|
||||
assert os.path.exists(msg_pbts_out)
|
||||
|
||||
touch(stamp_file)
|
||||
|
|
|
@ -8,30 +8,31 @@ import subprocess
|
|||
import sys
|
||||
import os
|
||||
|
||||
def symlink(target, name, target_is_dir=False):
|
||||
if os.name == "nt":
|
||||
import ctypes
|
||||
CreateSymbolicLinkW = ctypes.windll.kernel32.CreateSymbolicLinkW
|
||||
CreateSymbolicLinkW.restype = ctypes.c_ubyte
|
||||
CreateSymbolicLinkW.argtypes = (ctypes.c_wchar_p,
|
||||
ctypes.c_wchar_p,
|
||||
ctypes.c_uint32)
|
||||
|
||||
flags = 0x02 # SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
|
||||
if (target_is_dir):
|
||||
flags |= 0x01 # SYMBOLIC_LINK_FLAG_DIRECTORY
|
||||
if not CreateSymbolicLinkW(name, target, flags):
|
||||
raise ctypes.WinError()
|
||||
else:
|
||||
os.symlink(target, name)
|
||||
def symlink(target, name, target_is_dir=False):
|
||||
if os.name == "nt":
|
||||
import ctypes
|
||||
CreateSymbolicLinkW = ctypes.windll.kernel32.CreateSymbolicLinkW
|
||||
CreateSymbolicLinkW.restype = ctypes.c_ubyte
|
||||
CreateSymbolicLinkW.argtypes = (ctypes.c_wchar_p, ctypes.c_wchar_p,
|
||||
ctypes.c_uint32)
|
||||
|
||||
flags = 0x02 # SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
|
||||
if (target_is_dir):
|
||||
flags |= 0x01 # SYMBOLIC_LINK_FLAG_DIRECTORY
|
||||
if not CreateSymbolicLinkW(name, target, flags):
|
||||
raise ctypes.WinError()
|
||||
else:
|
||||
os.symlink(target, name)
|
||||
|
||||
|
||||
js_path = os.path.dirname(os.path.realpath(__file__))
|
||||
node_modules_path = os.path.join(js_path, "node_modules")
|
||||
|
||||
if not os.path.lexists("node_modules"):
|
||||
if os.path.exists("node_modules"):
|
||||
os.unlink("node_modules")
|
||||
symlink(node_modules_path, "node_modules", True)
|
||||
if os.path.exists("node_modules"):
|
||||
os.unlink("node_modules")
|
||||
symlink(node_modules_path, "node_modules", True)
|
||||
|
||||
args = ["node"] + sys.argv[1:]
|
||||
sys.exit(subprocess.call(args))
|
||||
|
|
|
@ -4,7 +4,7 @@ clang-format -i -style Google *.cc *.h include/*.h
|
|||
gn format BUILD.gn
|
||||
gn format deno.gni
|
||||
gn format .gn
|
||||
yapf -i tools/*.py
|
||||
yapf -i tools/*.py js/*.py
|
||||
prettier --write \
|
||||
js/deno.d.ts \
|
||||
js/main.ts \
|
||||
|
|
Loading…
Add table
Reference in a new issue