Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie committed Sep 23, 2024
1 parent 631b38d commit 4eadf41
Show file tree
Hide file tree
Showing 34 changed files with 271 additions and 2,002 deletions.
13 changes: 12 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@
ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

# Install additional OS packages, if needed.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates

# zScaler certificate, for all busy engineers
ADD zscaler.pem /usr/local/share/ca-certificates/zscaler.crt
RUN sudo chmod 644 /usr/local/share/ca-certificates/zscaler.crt && sudo update-ca-certificates

# Set the environment variable NODE_EXTRA_CA_CERTS to the zScaler certificate
ENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/zscaler.crt

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install protobuf-compiler
# && apt-get -y install protobuf-compiler
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "katallaxie/v8go",
"name": "zeiss/v8go",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
Expand All @@ -23,4 +23,4 @@
]
}
}
}
}
28 changes: 28 additions & 0 deletions .devcontainer/zscaler.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN CERTIFICATE-----
MIIE0zCCA7ugAwIBAgIJANu+mC2Jt3uTMA0GCSqGSIb3DQEBCwUAMIGhMQswCQYD
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2Ux
FTATBgNVBAoTDFpzY2FsZXIgSW5jLjEVMBMGA1UECxMMWnNj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CQEWE3N1cHBvcnRAenNjYWxlci5jb22CCQDbvpgtibd7kzAMBgNVHRMEBTAD
AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAw0NdJh8w3NsJu4KHuVZUrmZgIohnTm0j+
RTmYQ9IKA/pvxAcA6K1i/LO+Bt+tCX+C0yxqB8qzuo+4vAzoY5JEBhyhBhf1uK+P
/WVWFZN/+hTgpSbZgzUEnWQG2gOVd24msex+0Sr7hyr9vn6OueH+jj+vCMiAm5+u
kd7lLvJsBu3AO3jGWVLyPkS3i6Gf+rwAp1OsRrv3WnbkYcFf9xjuaf4z0hRCrLN2
xFNjavxrHmsH8jPHVvgc1VD0Opja0l/BRVauTrUaoW6tE+wFG5rEcPGS80jjHK4S
pB5iDj2mUZH1T8lzYtuZy0ZPirxmtsk3135+CKNa2OCAhhFjE0xd
-----END CERTIFICATE-----
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- id: version
run: echo "::set-output name=tag::${GITHUB_REF/refs\/tags\//}"
- id: changelog
run: echo "${{ steps.version.outputs.tag }}---$(date +'%Y-%m-%d')" | sed -e 's/\.//g' | awk '{print "::set-output name=url::https://github.com/katallaxie/v8go/blob/main/CHANGELOG.md#" $1}'
run: echo "${{ steps.version.outputs.tag }}---$(date +'%Y-%m-%d')" | sed -e 's/\.//g' | awk '{print "::set-output name=url::https://github.com/zeiss/v8go/blob/main/CHANGELOG.md#" $1}'
- uses: softprops/action-gh-release@v2
with:
draft: true
Expand Down
210 changes: 177 additions & 33 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,121 @@
# See https://raw.githubusercontent.com/golangci/golangci-lint/master/.golangci.example.yml

run:
timeout: 5m
deadline: 6m

skip-files:
- ".*_mock\\.go$"
- "\\.pb\\.go$"
- "zz_generated\\..+\\.go$"

skip-dirs:
- "deps"
- vendor$

output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number

linters-settings:
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false

# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: false

# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,io/ioutil:^Read.*

govet:
# report about shadowed variables
check-shadowing: false

golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8

gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true

goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/crossplane/provider-template

gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 10

maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true

dupl:
# tokens count to trigger issue, 150 by default
threshold: 100

goconst:
# minimal length of string constant, 3 by default
min-len: 3
# minimal occurrences count to trigger, 3 by default
min-occurrences: 5

lll:
# tab width in spaces. Default to 1.
tab-width: 1

unused:
# treat code as a program (not a library) and report unused exported identifiers; default is false.
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false

unparam:
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false

nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 30

prealloc:
# XXX: we don't recommend using this linter before doing performance profiling.
# For most programs usage of prealloc will be a premature optimization.

# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
# True by default.
simple: true
range-loops: true # Report preallocation suggestions on range loops, true by default
for-loops: false # Report preallocation suggestions on for loops, false by default

gocritic:
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
enabled-tags:
- performance

settings: # settings passed to gocritic
captLocal: # must be valid enabled check name
paramsOnly: true
rangeValCopy:
sizeThreshold: 32

revive:
severity: warning
confidence: 0.8


linters:
enable:
- megacheck
- govet
- gocyclo
- gocritic
- goconst
- goimports
- gofmt # We enable this as well as goimports for its simplify mode.
Expand All @@ -29,39 +127,85 @@ linters:
- exportloopref
- gosec

linters-settings:
dupl:
threshold: 100
goconst:
ignore-tests: true
min-len: 2
min-occurrences: 2
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
golint:
min-confidence: 0
lll:
line-length: 140
maligned:
suggest-new: true
disable:
- scopelint
- errcheck

presets:
- bugs
- unused
fast: false


issues:
exclude:
- "G103: Use of unsafe calls should be audited"

# Excluding configuration per-path and per-linter
exclude-rules:
- path: _test\.go
# Exclude some linters from running on tests files.
- path: _test(ing)?\.go
linters:
- bodyclose
- dupl
- errcheck
- gocyclo
- errcheck
- dupl
- gosec
- lll
- scopelint
- unparam
- deadcode

# Ease some gocritic warnings on test files.
- path: _test\.go
text: "(unnamedResult|exitAfterDefer)"
linters:
- gocritic

# These are performance optimisations rather than style issues per se.
# They warn when function arguments or range values copy a lot of memory
# rather than using a pointer.
- text: "(hugeParam|rangeValCopy):"
linters:
- gocritic

# This "TestMain should call os.Exit to set exit code" warning is not clever
# enough to notice that we call a helper method that calls os.Exit.
- text: "SA3000:"
linters:
- staticcheck

- text: "k8s.io/api/core/v1"
linters:
- goimports

# This is a "potential hardcoded credentials" warning. It's triggered by
# any variable with 'secret' in the same, and thus hits a lot of false
# positives in Kubernetes land where a Secret is an object type.
- text: "G101:"
linters:
- gosec
- gas

- path: /doc\.go$
# This is an 'errors unhandled' warning that duplicates errcheck.
- text: "G104:"
linters:
- lll
- gosec
- gas

# Independently from option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
exclude-use-default: false

# Show only new issues: if there are unstaged changes or untracked files,
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
# It's a super-useful option for integration of golangci-lint into existing
# large codebase. It's not practical to fix all existing issues at the moment
# of integration: much better don't allow issues in new code.
# Default is false.
new: false

# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-per-linter: 0

- linters:
- lll
source: "^//go:generate "
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2019 Roger Chapman and the v8go contributors.
Copyright (c) 2024 Sebastian Döll and ZEISS Group.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Execute JavaScript from Go

<a href="https://github.com/katallaxie/v8go/releases"><img src="https://img.shields.io/github/v/release/katallaxie/v8go" alt="Github release"></a>
[![Go Report Card](https://goreportcard.com/badge/katallaxie/v8go)](https://goreportcard.com/report/katallaxie/v8go)
[![Go Reference](https://pkg.go.dev/badge/katallaxie/v8go.svg)](https://pkg.go.dev/katallaxie/v8go)
[![Test](https://github.com/katallaxie/v8go/actions/workflows/main.yml/badge.svg)](https://github.com/katallaxie/v8go/actions/workflows/main.yml)
![V8 Build](https://github.com/katallaxie/v8go/workflows/V8%20Build/badge.svg)
[![codecov](https://codecov.io/gh/katallaxie/v8go/branch/master/graph/badge.svg?token=VHZwzGm3dV)](https://codecov.io/gh/katallaxie/v8go)
<a href="https://github.com/zeiss/v8go/releases"><img src="https://img.shields.io/github/v/release/zeiss/v8go" alt="Github release"></a>
[![Go Report Card](https://goreportcard.com/badge/zeiss/v8go)](https://goreportcard.com/report/zeiss/v8go)
[![Go Reference](https://pkg.go.dev/badge/zeiss/v8go.svg)](https://pkg.go.dev/zeiss/v8go)
[![Test](https://github.com/zeiss/v8go/actions/workflows/main.yml/badge.svg)](https://github.com/zeiss/v8go/actions/workflows/main.yml)
![V8 Build](https://github.com/zeiss/v8go/workflows/V8%20Build/badge.svg)
[![codecov](https://codecov.io/gh/zeiss/v8go/branch/master/graph/badge.svg?token=VHZwzGm3dV)](https://codecov.io/gh/zeiss/v8go)

<img src="gopher.jpg" width="200px" alt="V8 Gopher based on original artwork from the amazing Renee French" />

## Usage

```go
import v8 "github.com/katallaxie/v8go"
import v8 "github.com/zeiss/v8go"
```

### Running a script
Expand Down Expand Up @@ -181,7 +181,7 @@ func printTree(nest string, node *v8.CPUProfileNode) {

## Documentation

Go Reference & more examples: https://pkg.go.dev/katallaxie/v8go
Go Reference & more examples: https://pkg.go.dev/zeiss/v8go

### Support

Expand All @@ -190,7 +190,7 @@ please join the [**#v8go**](https://gophers.slack.com/channels/v8go) channel on

### Windows

There used to be Windows binary support. For further information see, [PR #234](https://github.com/katallaxie/v8go/pull/234).
There used to be Windows binary support. For further information see, [PR #234](https://github.com/zeiss/v8go/pull/234).

The v8go library would welcome contributions from anyone able to get an external windows
build of the V8 library linking with v8go, using the version of V8 checked out in the
Expand Down Expand Up @@ -219,7 +219,7 @@ This project also aims to keep up-to-date with the latest (stable) release of V8

## License

[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B22862%2Fgit%40github.com%3Akatallaxie%2Fv8go.git.svg?type=large)](https://app.fossa.com/projects/custom%2B22862%2Fgit%40github.com%3Akatallaxie%2Fv8go.git?ref=badge_large)
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B22862%2Fgit%40github.com%3Azeiss%2Fv8go.git.svg?type=large)](https://app.fossa.com/projects/custom%2B22862%2Fgit%40github.com%3Azeiss%2Fv8go.git?ref=badge_large)

## Development

Expand All @@ -234,15 +234,15 @@ This project also aims to keep up-to-date with the latest (stable) release of V8

### Upgrading the V8 binaries

We have the [upgradev8](https://github.com/katallaxie/v8go/.github/workflow/v8upgrade.yml) workflow.
We have the [upgradev8](https://github.com/zeiss/v8go/.github/workflow/v8upgrade.yml) workflow.
The workflow is triggered every day or manually.

If the current [v8_version](https://github.com/katallaxie/v8go/deps/v8_version) is different from the latest stable version, the workflow takes care of fetching the latest stable v8 files and copying them into `deps/include`. The last step of the workflow opens a new PR with the branch name `v8_upgrade/<v8-version>` with all the changes.
If the current [v8_version](https://github.com/zeiss/v8go/deps/v8_version) is different from the latest stable version, the workflow takes care of fetching the latest stable v8 files and copying them into `deps/include`. The last step of the workflow opens a new PR with the branch name `v8_upgrade/<v8-version>` with all the changes.

The next steps are:

1) The build is not yet triggered automatically. To trigger it manually, go to the [V8
Build](https://github.com/katallaxie/v8go/actions?query=workflow%3A%22V8+Build%22) Github Action, Select "Run workflow",
Build](https://github.com/zeiss/v8go/actions?query=workflow%3A%22V8+Build%22) Github Action, Select "Run workflow",
and select your pushed branch eg. `v8_upgrade/<v8-version>`.
1) Once built, this should open 3 PRs against your branch to add the `libv8.a` for Linux (for x86_64) and macOS for x86_64 and arm64; merge
these PRs into your branch. You are now ready to raise the PR against `master` with the latest version of V8.
Expand Down Expand Up @@ -300,4 +300,4 @@ Go has `go fmt`, C has `clang-format`. Any changes to the `v8go.h|cc` should be

---

V8 Gopher image based on original artwork from the amazing [Renee French](http://reneefrench.blogspot.com).
V8 Gopher image based on original artwork from the amazing [Renee French](http://reneefrench.blogspot.com).
Loading

0 comments on commit 4eadf41

Please sign in to comment.