Skip to content

Commit

Permalink
Chore: Ignore cyclomatic complexity for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
joeturki committed Jan 2, 2025
1 parent 27457da commit 9f44403
Show file tree
Hide file tree
Showing 22 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/bandwidth-estimation-from-disk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
ivfHeaderSize = 32
)

// nolint: gocognit
// nolint: gocognit, cyclop
func main() {
qualityLevels := []struct {
fileName string
Expand Down
3 changes: 2 additions & 1 deletion examples/broadcast/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import (
"github.com/pion/webrtc/v4"
)

func main() { // nolint:gocognit
// nolint:gocognit, cyclop
func main() {
port := flag.Int("port", 8080, "http server port")
flag.Parse()

Expand Down
1 change: 1 addition & 0 deletions examples/custom-logger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (c customLoggerFactory) NewLogger(subsystem string) logging.LeveledLogger {
return customLogger{}
}

// nolint: cyclop
func main() {
// Create a new API with a custom logger
// This SettingEngine allows non-standard WebRTC behavior
Expand Down
1 change: 1 addition & 0 deletions examples/data-channels/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/pion/webrtc/v4"
)

// nolint:cyclop
func main() {
// Everything below is the Pion WebRTC API! Thanks for using it ❤️.

Expand Down
1 change: 1 addition & 0 deletions examples/ice-restart/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

var peerConnection *webrtc.PeerConnection //nolint

// nolint: cyclop
func doSignaling(w http.ResponseWriter, r *http.Request) {
var err error

Expand Down
1 change: 1 addition & 0 deletions examples/ice-tcp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func doSignaling(w http.ResponseWriter, r *http.Request) {
}
}

//nolint:cyclop
func main() {
settingEngine := webrtc.SettingEngine{}

Expand Down
2 changes: 1 addition & 1 deletion examples/insertable-streams/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

const cipherKey = 0xAA

// nolint:gocognit
// nolint:gocognit, cyclop
func main() {
peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{
ICEServers: []webrtc.ICEServer{
Expand Down
1 change: 1 addition & 0 deletions examples/ortc-media/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const (
videoFileName = "output.ivf"
)

// nolint:cyclop
func main() {
isOffer := flag.Bool("offer", false, "Act as the offerer if set")
port := flag.Int("port", 8080, "http server port")
Expand Down
1 change: 1 addition & 0 deletions examples/ortc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/pion/webrtc/v4"
)

// nolint:cyclop
func main() {
isOffer := flag.Bool("offer", false, "Act as the offerer if set")
port := flag.Int("port", 8080, "http server port")
Expand Down
3 changes: 2 additions & 1 deletion examples/pion-to-pion/answer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ func signalCandidate(addr string, c *webrtc.ICECandidate) error {
return resp.Body.Close()
}

func main() { // nolint:gocognit
// nolint:gocognit, cyclop
func main() {
offerAddr := flag.String("offer-address", "localhost:50000", "Address that the Offer HTTP server is hosted on.")
answerAddr := flag.String("answer-address", ":60000", "Address that the Answer HTTP server is hosted on.")
flag.Parse()
Expand Down
3 changes: 2 additions & 1 deletion examples/pion-to-pion/offer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ func signalCandidate(addr string, c *webrtc.ICECandidate) error {
return resp.Body.Close()
}

func main() { //nolint:gocognit
//nolint:gocognit, cyclop
func main() {
offerAddr := flag.String("offer-address", ":50000", "Address that the Offer HTTP server is hosted on.")
answerAddr := flag.String("answer-address", "127.0.0.1:60000", "Address that the Answer HTTP server is hosted on.")
flag.Parse()
Expand Down
2 changes: 1 addition & 1 deletion examples/play-from-disk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
oggPageDuration = time.Millisecond * 20
)

// nolint:gocognit
// nolint:gocognit, cyclop
func main() {
// Assert that we have an audio or video file
_, err := os.Stat(videoFileName)
Expand Down
2 changes: 1 addition & 1 deletion examples/reflect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/pion/webrtc/v4"
)

// nolint:gocognit
// nolint:gocognit, cyclop
func main() {
// Everything below is the Pion WebRTC API! Thanks for using it ❤️.

Expand Down
2 changes: 1 addition & 1 deletion examples/rtp-forwarder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type udpConn struct {
payloadType uint8
}

// nolint:gocognit
// nolint:gocognit, cyclop
func main() {
// Everything below is the Pion WebRTC API! Thanks for using it ❤️.

Expand Down
1 change: 1 addition & 0 deletions examples/rtp-to-webrtc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/pion/webrtc/v4"
)

// nolint:cyclop
func main() {
peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{
ICEServers: []webrtc.ICEServer{
Expand Down
1 change: 1 addition & 0 deletions examples/save-to-disk-av1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func saveToDisk(i media.Writer, track *webrtc.TrackRemote) {
}
}

// nolint:cyclop
func main() {
// Everything below is the Pion WebRTC API! Thanks for using it ❤️.

Expand Down
2 changes: 1 addition & 1 deletion examples/save-to-disk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func saveToDisk(i media.Writer, track *webrtc.TrackRemote) {
}
}

// nolint:gocognit
// nolint:gocognit, cyclop
func main() {
// Everything below is the Pion WebRTC API! Thanks for using it ❤️.

Expand Down
2 changes: 1 addition & 1 deletion examples/simulcast/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/pion/webrtc/v4"
)

// nolint:gocognit
// nolint:gocognit, cyclop
func main() {
// Everything below is the Pion WebRTC API! Thanks for using it ❤️.

Expand Down
2 changes: 1 addition & 1 deletion examples/stats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// How ofter to print WebRTC stats
const statsInterval = time.Second * 5

// nolint:gocognit
// nolint:gocognit,cyclop
func main() {
// Everything below is the Pion WebRTC API! Thanks for using it ❤️.

Expand Down
1 change: 1 addition & 0 deletions examples/swap-tracks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/pion/webrtc/v4"
)

// nolint: cyclop
func main() { // nolint:gocognit
// Everything below is the Pion WebRTC API! Thanks for using it ❤️.

Expand Down
3 changes: 2 additions & 1 deletion examples/trickle-ice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import (
)

// websocketServer is called for every new inbound WebSocket
func websocketServer(ws *websocket.Conn) { // nolint:gocognit
// nolint: gocognit, cyclop
func websocketServer(ws *websocket.Conn) {
// Create a new RTCPeerConnection
peerConnection, err := webrtc.NewPeerConnection(webrtc.Configuration{})
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions examples/vnet/show-network-usage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
+--------------------+ +--------------------+
*/

// nolint:cyclop
func main() {
var inboundBytes int32 // for offerPeerConnection
var outboundBytes int32 // for offerPeerConnection
Expand Down

0 comments on commit 9f44403

Please sign in to comment.