Skip to content

Commit

Permalink
pkg: replace algorithms with go.bug.st/f
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-perugini committed Jan 13, 2025
1 parent 34e79e1 commit f4cbfed
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 155 deletions.
45 changes: 45 additions & 0 deletions .licenses/go/go.bug.st/f.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: go.bug.st/f
version: v0.4.0
type: go
summary: Package f is a golang library implementing some basic algorithms.
homepage: https://godoc.org/go.bug.st/f
license: bsd-3-clause
licenses:
- sources: LICENSE
text: |2+
Copyright (c) 2024, Cristian Maglie.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
notices: []
...
2 changes: 1 addition & 1 deletion commands/service_board_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (

"github.com/arduino/arduino-cli/commands/cmderrors"
"github.com/arduino/arduino-cli/commands/internal/instances"
f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/arduino/discovery/discoverymanager"
"github.com/arduino/arduino-cli/internal/i18n"
"github.com/arduino/arduino-cli/pkg/fqbn"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"go.bug.st/f"
)

// BoardList returns a list of boards found by the loaded discoveries.
Expand Down
2 changes: 1 addition & 1 deletion commands/service_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"reflect"

"github.com/arduino/arduino-cli/commands/cmderrors"
f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/cli/configuration"
"github.com/arduino/arduino-cli/internal/go-configmap"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"go.bug.st/f"
"google.golang.org/protobuf/proto"
"gopkg.in/yaml.v3"
)
Expand Down
87 changes: 0 additions & 87 deletions internal/algorithms/slices.go

This file was deleted.

53 changes: 0 additions & 53 deletions internal/algorithms/slices_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion internal/arduino/builder/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (
"os"
"strings"

f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/arduino/builder/cpp"
"github.com/arduino/arduino-cli/internal/arduino/builder/internal/utils"
"github.com/arduino/arduino-cli/internal/buildcache"
"github.com/arduino/arduino-cli/internal/i18n"
"github.com/arduino/go-paths-helper"
"go.bug.st/f"
)

// buildCore fixdoc
Expand Down
2 changes: 1 addition & 1 deletion internal/arduino/builder/internal/preprocessor/gcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"fmt"
"strings"

f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/arduino/builder/cpp"
"github.com/arduino/arduino-cli/internal/i18n"
"github.com/arduino/go-paths-helper"
"github.com/arduino/go-properties-orderedmap"
"go.bug.st/f"
)

// GCC performs a run of the gcc preprocess (macro/includes expansion). The function outputs the result
Expand Down
2 changes: 1 addition & 1 deletion internal/arduino/builder/internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"strings"
"unicode"

f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/go-paths-helper"
"github.com/sirupsen/logrus"
"go.bug.st/f"
"golang.org/x/text/runes"
"golang.org/x/text/transform"
"golang.org/x/text/unicode/norm"
Expand Down
2 changes: 1 addition & 1 deletion internal/arduino/builder/libraries.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
"strings"
"time"

f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/arduino/builder/cpp"
"github.com/arduino/arduino-cli/internal/arduino/libraries"
"github.com/arduino/arduino-cli/internal/i18n"
"github.com/arduino/go-paths-helper"
"github.com/arduino/go-properties-orderedmap"
"go.bug.st/f"
)

// nolint
Expand Down
2 changes: 1 addition & 1 deletion internal/arduino/builder/linker.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package builder
import (
"strings"

f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/i18n"
"github.com/arduino/go-paths-helper"
"go.bug.st/f"
)

// link fixdoc
Expand Down
2 changes: 1 addition & 1 deletion internal/arduino/builder/sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
"strings"

"fortio.org/safecast"
f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/arduino/builder/cpp"
"github.com/arduino/arduino-cli/internal/i18n"
"github.com/arduino/go-paths-helper"
"github.com/marcinbor85/gohex"
"go.bug.st/f"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/arduino/sketch/sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"strings"

"github.com/arduino/arduino-cli/commands/cmderrors"
f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/arduino/globals"
"github.com/arduino/arduino-cli/internal/i18n"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/go-paths-helper"
"go.bug.st/f"
)

// Sketch holds all the files composing a sketch
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/arguments/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package arguments
import (
"context"

f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/cli/instance"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"go.bug.st/f"
)

// GetInstalledBoards is an helper function useful to autocomplete.
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/arguments/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import (

"github.com/arduino/arduino-cli/commands"
"github.com/arduino/arduino-cli/commands/cmderrors"
f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/i18n"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"go.bug.st/f"
)

// Port contains the port arguments result.
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/arguments/sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ package arguments
import (
"context"

f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/cli/feedback"
"github.com/arduino/arduino-cli/internal/i18n"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/go-paths-helper"
"github.com/sirupsen/logrus"
"go.bug.st/f"
)

// InitSketchPath returns an instance of paths.Path pointing to sketchPath.
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
"os"
"strings"

f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/cli/feedback"
"github.com/arduino/arduino-cli/internal/i18n"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/go-paths-helper"
"github.com/spf13/cobra"
"go.bug.st/f"
)

// NewCommand created a new `config` command
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/config/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
"encoding/json"
"os"

f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/cli/feedback"
"github.com/arduino/arduino-cli/internal/i18n"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"go.bug.st/f"
)

func initSetCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/feedback/result/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"fmt"
"slices"

f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/arduino-cli/internal/i18n"
"github.com/arduino/arduino-cli/internal/orderedmap"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"go.bug.st/f"
semver "go.bug.st/relaxed-semver"
)

Expand Down

0 comments on commit f4cbfed

Please sign in to comment.