Skip to content

Rename tool to final name: arduino-lint #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build artifacts
arduino-check
arduino-check.exe
arduino-lint
arduino-lint.exe

# Test artifacts
coverage_unit.txt
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# arduino-check
# arduino-lint

`arduino-check` is a command line tool that automatically checks for common problems in your
`arduino-lint` is a command line tool that automatically checks for common problems in your
[Arduino](https://www.arduino.cc/) projects:

- Sketches
- Libraries

## Usage

After installing `arduino-check`, run the command `arduino-check --help` for usage documentation.
After installing `arduino-lint`, run the command `arduino-lint --help` for usage documentation.

A few additional configuration options only of use for internal/development use of the tool can be set via environment
variables:

- `ARDUINO_CHECK_OFFICIAL` - Set to `"true"` to run the checks that only apply to official Arduino projects.
- `ARDUINO_CHECK_LOG_LEVEL` - Messages with this level and above will be logged.
- `ARDUINO_LINT_OFFICIAL` - Set to `"true"` to run the checks that only apply to official Arduino projects.
- `ARDUINO_LINT_LOG_LEVEL` - Messages with this level and above will be logged.
- Supported values: `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`
- `ARDUINO_CHECK_LOG_FORMAT` - The output format for the logs.
- `ARDUINO_LINT_LOG_FORMAT` - The output format for the logs.
- Supported values: `text`, `json`
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ vars:
TIMESTAMP:
sh: echo "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
LDFLAGS: >
-ldflags '-X github.com/arduino/arduino-check/configuration.commit={{.COMMIT}} -X github.com/arduino/arduino-check/configuration.buildTimestamp={{.TIMESTAMP}}'
-ldflags '-X github.com/arduino/arduino-lint/configuration.commit={{.COMMIT}} -X github.com/arduino/arduino-lint/configuration.buildTimestamp={{.TIMESTAMP}}'
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic"

GOLINTFLAGS: "-min_confidence 0.8 -set_exit_status"
Expand All @@ -206,5 +206,5 @@ vars:

WORKFLOW_SCHEMA_PATH: "$(mktemp -t gha-workflow-schema-XXXXXXXXXX.json)"

CODESPELL_SKIP_OPTION: '--skip "./.git,./go.mod,./go.sum,./arduino-check,./arduino-check.exe,./check/checkfunctions/testdata/libraries/MisspelledSentenceParagraphValue/library.properties"'
CODESPELL_SKIP_OPTION: '--skip "./.git,./go.mod,./go.sum,./arduino-lint,./arduino-lint.exe,./check/checkfunctions/testdata/libraries/MisspelledSentenceParagraphValue/library.properties"'
CODESPELL_IGNORE_WORDS_OPTION: "--ignore-words ./etc/codespell-ignore-words-list.txt"
20 changes: 10 additions & 10 deletions check/check.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand All @@ -19,14 +19,14 @@ package check
import (
"fmt"

"github.com/arduino/arduino-check/check/checkconfigurations"
"github.com/arduino/arduino-check/check/checkdata"
"github.com/arduino/arduino-check/check/checkresult"
"github.com/arduino/arduino-check/configuration"
"github.com/arduino/arduino-check/configuration/checkmode"
"github.com/arduino/arduino-check/project"
"github.com/arduino/arduino-check/result"
"github.com/arduino/arduino-check/result/feedback"
"github.com/arduino/arduino-lint/check/checkconfigurations"
"github.com/arduino/arduino-lint/check/checkdata"
"github.com/arduino/arduino-lint/check/checkresult"
"github.com/arduino/arduino-lint/configuration"
"github.com/arduino/arduino-lint/configuration/checkmode"
"github.com/arduino/arduino-lint/project"
"github.com/arduino/arduino-lint/result"
"github.com/arduino/arduino-lint/result/feedback"
"github.com/sirupsen/logrus"
)

Expand Down
16 changes: 8 additions & 8 deletions check/check_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand All @@ -18,12 +18,12 @@ package check
import (
"testing"

"github.com/arduino/arduino-check/check/checkconfigurations"
"github.com/arduino/arduino-check/configuration"
"github.com/arduino/arduino-check/configuration/checkmode"
"github.com/arduino/arduino-check/project"
"github.com/arduino/arduino-check/project/projecttype"
"github.com/arduino/arduino-check/util/test"
"github.com/arduino/arduino-lint/check/checkconfigurations"
"github.com/arduino/arduino-lint/configuration"
"github.com/arduino/arduino-lint/configuration/checkmode"
"github.com/arduino/arduino-lint/project"
"github.com/arduino/arduino-lint/project/projecttype"
"github.com/arduino/arduino-lint/util/test"
"github.com/stretchr/testify/assert"
)

Expand Down
10 changes: 5 additions & 5 deletions check/checkconfigurations/checkconfigurations.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand All @@ -24,9 +24,9 @@ Package checkconfigurations defines the configuration of each check:
package checkconfigurations

import (
"github.com/arduino/arduino-check/check/checkfunctions"
"github.com/arduino/arduino-check/configuration/checkmode"
"github.com/arduino/arduino-check/project/projecttype"
"github.com/arduino/arduino-lint/check/checkfunctions"
"github.com/arduino/arduino-lint/configuration/checkmode"
"github.com/arduino/arduino-lint/project/projecttype"
)

// Type is the type for check configurations.
Expand Down
12 changes: 6 additions & 6 deletions check/checkconfigurations/checkconfigurations_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand All @@ -19,10 +19,10 @@ import (
"fmt"
"testing"

"github.com/arduino/arduino-check/check"
"github.com/arduino/arduino-check/check/checkconfigurations"
"github.com/arduino/arduino-check/check/checklevel"
"github.com/arduino/arduino-check/configuration/checkmode"
"github.com/arduino/arduino-lint/check"
"github.com/arduino/arduino-lint/check/checkconfigurations"
"github.com/arduino/arduino-lint/check/checklevel"
"github.com/arduino/arduino-lint/configuration/checkmode"
"github.com/stretchr/testify/assert"
)

Expand Down
10 changes: 5 additions & 5 deletions check/checkdata/checkdata.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand All @@ -20,9 +20,9 @@ This is for data required by multiple checks.
package checkdata

import (
"github.com/arduino/arduino-check/project"
"github.com/arduino/arduino-check/project/packageindex"
"github.com/arduino/arduino-check/project/projecttype"
"github.com/arduino/arduino-lint/project"
"github.com/arduino/arduino-lint/project/packageindex"
"github.com/arduino/arduino-lint/project/projecttype"
"github.com/arduino/go-paths-helper"
)

Expand Down
14 changes: 7 additions & 7 deletions check/checkdata/library.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand All @@ -21,12 +21,12 @@ import (
"net/http"
"os"

"github.com/arduino/arduino-check/check/checkdata/schema"
"github.com/arduino/arduino-check/check/checkdata/schema/compliancelevel"
"github.com/arduino/arduino-check/project"
"github.com/arduino/arduino-check/project/library/libraryproperties"
"github.com/arduino/arduino-check/result/feedback"
"github.com/arduino/arduino-cli/arduino/libraries"
"github.com/arduino/arduino-lint/check/checkdata/schema"
"github.com/arduino/arduino-lint/check/checkdata/schema/compliancelevel"
"github.com/arduino/arduino-lint/project"
"github.com/arduino/arduino-lint/project/library/libraryproperties"
"github.com/arduino/arduino-lint/result/feedback"
"github.com/arduino/go-properties-orderedmap"
"github.com/client9/misspell"
"github.com/sirupsen/logrus"
Expand Down
4 changes: 2 additions & 2 deletions check/checkdata/packageindex.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand Down
8 changes: 4 additions & 4 deletions check/checkdata/packageindex_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand All @@ -18,8 +18,8 @@ package checkdata
import (
"testing"

"github.com/arduino/arduino-check/project"
"github.com/arduino/arduino-check/project/projecttype"
"github.com/arduino/arduino-lint/project"
"github.com/arduino/arduino-lint/project/projecttype"
"github.com/arduino/go-paths-helper"
"github.com/stretchr/testify/assert"
)
Expand Down
8 changes: 4 additions & 4 deletions check/checkdata/platform.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand All @@ -16,8 +16,8 @@
package checkdata

import (
"github.com/arduino/arduino-check/project"
"github.com/arduino/arduino-check/project/platform/boardstxt"
"github.com/arduino/arduino-lint/project"
"github.com/arduino/arduino-lint/project/platform/boardstxt"
"github.com/arduino/go-properties-orderedmap"
)

Expand Down
8 changes: 4 additions & 4 deletions check/checkdata/platform_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand All @@ -18,8 +18,8 @@ package checkdata
import (
"testing"

"github.com/arduino/arduino-check/project"
"github.com/arduino/arduino-check/project/projecttype"
"github.com/arduino/arduino-lint/project"
"github.com/arduino/arduino-lint/project/projecttype"
"github.com/arduino/go-paths-helper"
"github.com/stretchr/testify/assert"
)
Expand Down
4 changes: 2 additions & 2 deletions check/checkdata/schema/compliancelevel/compliancelevel.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand Down
4 changes: 2 additions & 2 deletions check/checkdata/schema/parsevalidationresult.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand Down
4 changes: 2 additions & 2 deletions check/checkdata/schema/schema.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand Down
10 changes: 5 additions & 5 deletions check/checkdata/schema/schema_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// This file is part of arduino-check.
// This file is part of arduino-lint.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
//
// This software is released under the GNU General Public License version 3,
// which covers the main part of arduino-check.
// which covers the main part of arduino-lint.
// The terms of this license can be found at:
// https://www.gnu.org/licenses/gpl-3.0.en.html
//
Expand All @@ -19,7 +19,7 @@ import (
"regexp"
"testing"

"github.com/arduino/arduino-check/check/checkdata/schema/testdata"
"github.com/arduino/arduino-lint/check/checkdata/schema/testdata"
"github.com/arduino/go-properties-orderedmap"
"github.com/ory/jsonschema/v3"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -199,14 +199,14 @@ func Test_schemaID(t *testing.T) {
require.NotNil(t, err)

id, err := schemaID("valid-schema.json", testdata.Asset)
require.Equal(t, "https://raw.githubusercontent.com/arduino/arduino-check/main/check/checkdata/schema/testdata/schema-with-references.json", id)
require.Equal(t, "https://raw.githubusercontent.com/arduino/arduino-lint/main/check/checkdata/schema/testdata/schema-with-references.json", id)
require.Nil(t, err)
}

func Test_validationErrorSchemaPointerValue(t *testing.T) {
validationError := ValidationResult{
Result: &jsonschema.ValidationError{
SchemaURL: "https://raw.githubusercontent.com/arduino/arduino-check/main/check/checkdata/schema/testdata/referenced-schema-1.json",
SchemaURL: "https://raw.githubusercontent.com/arduino/arduino-lint/main/check/checkdata/schema/testdata/referenced-schema-1.json",
SchemaPtr: "#/definitions/patternObject/pattern",
},
dataLoader: testdata.Asset,
Expand Down
Loading