From 31aab3b962f3e0dc2d3ae890fb2bfc00ca9945ee Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 12 Mar 2022 09:41:32 -0800 Subject: [PATCH 1/5] Fix broken link in documentation The Arduino Library Manager documentation was moved to a new location without setting up a redirect, which broke this link. --- docs/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/index.md b/docs/index.md index a2064503f..7b400c7d7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -38,8 +38,9 @@ accepted by this flag are: ### Library Manager setting -[Arduino Library Manager](https://www.arduino.cc/en/guide/libraries#toc3) is the best way to provide installation and -updates of Arduino libraries. In order to be accepted for inclusion in Library Manager, a library is required to meet +[Arduino Library Manager](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries#using-the-library-manager) +is the best way to provide installation and updates of Arduino libraries. In order to be accepted for inclusion in +Library Manager, a library is required to meet [some requirements](https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ). **Arduino Lint** provides checks for these requirements as well, controlled by the `--library-manager` flag. From adbabd2da9f6e8bca9376817dd0bc22877809e13 Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 11 Mar 2022 13:06:08 -0800 Subject: [PATCH 2/5] Update redirecting links in documentation Even though these links were still reaching the intended page, it is best not to rely on redirects. --- docs/CONTRIBUTING.md | 18 +++++++++--------- docs/index.md | 7 +++---- .../ruleconfiguration/ruleconfiguration.go | 12 ++++++------ 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 76fb2c74a..5b8fdc1db 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -12,17 +12,17 @@ There are several ways you can get involved: | - Bug fix
- Enhancement | Pull Request (read the [pull request guidelines][prs]) | | Monetary | - [Donate][donate]
- [Buy official products][store] | -[forum]: https://forum.arduino.cc/index.php?board=3.0 +[forum]: https://forum.arduino.cc/c/using-arduino/project-guidance/19 [issues]: #issue-reports [nightly]: installation.md#nightly-builds [prs]: #pull-requests -[donate]: https://www.arduino.cc/en/Main/Contribute +[donate]: https://www.arduino.cc/en/donate/ [store]: https://store.arduino.cc ## Issue Reports Do you need help or have a question about using Arduino Lint? Support requests should be made to the -[Arduino forum](https://forum.arduino.cc/index.php?board=3.0). +[Arduino forum](https://forum.arduino.cc/c/using-arduino/project-guidance/19). High quality bug reports and feature requests are valuable contributions to the Arduino Lint project. @@ -31,8 +31,8 @@ High quality bug reports and feature requests are valuable contributions to the - Give the [nightly build](installation.md#nightly-builds) a test drive to see if your issue was already resolved. - Search [existing pull requests and issues](https://github.com/arduino/arduino-lint/issues?q=) to see if it was already reported. If you have additional information to provide about an existing issue, please comment there. You can use - [GitHub's "Reactions" feature](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) if you - only want to express support. + [GitHub's "Reactions" feature](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) if + you only want to express support. ### Qualities of an excellent report @@ -55,16 +55,16 @@ submitting a PR: - Create small PRs that are narrowly focused on addressing a single concern. - Write tests for the code you wrote. -- Maintain [**clean commit history**](http://www.freshconsulting.com/atomic-commits) and use - [**meaningful commit messages**](http://chris.beams.io/posts/git-commit). PRs with messy commit history are difficult - to review and require a lot of work to be merged. +- Maintain [**clean commit history**](https://www.freshconsulting.com/insights/blog/atomic-commits/) and use + [**meaningful commit messages**](https://cbea.ms/git-commit/). PRs with messy commit history are difficult to review + and require a lot of work to be merged. - If the PR contains a breaking change, please start the commit message and PR title with the string **[breaking]**. Don't forget to describe in the PR description what changes users might need to make in their workflow or application due to this PR. A breaking change is a change that forces users to change their command-line invocations or parsing of the JSON formatted output when upgrading from an older version of Arduino Lint. - PR titles indirectly become part of the CHANGELOG so it's crucial to provide a good record of **what** change is being made in the title; **why** it was made will go in the PR description, along with - [a link to a GitHub issue](https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) + [a link to a GitHub issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if one exists. - Open your PR against the `main` branch. - Your PR must pass all [CI](https://en.wikipedia.org/wiki/Continuous_integration) tests before we will merge it. You diff --git a/docs/index.md b/docs/index.md index 7b400c7d7..82efc625a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -41,7 +41,7 @@ accepted by this flag are: [Arduino Library Manager](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries#using-the-library-manager) is the best way to provide installation and updates of Arduino libraries. In order to be accepted for inclusion in Library Manager, a library is required to meet -[some requirements](https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ). +[some requirements](https://github.com/arduino/library-registry/blob/main/FAQ.md#readme). **Arduino Lint** provides checks for these requirements as well, controlled by the `--library-manager` flag. @@ -79,8 +79,7 @@ Additional configuration options intended for internal use or development can be [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) system. Running the tool after each change to the project can allow you to identify any problems that were introduced. -This is easily done by using the `arduino/arduino-lint-action` -[GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions) action: +This is easily done by using the `arduino/arduino-lint-action` [GitHub Actions](https://docs.github.com/actions) action: https://github.com/arduino/arduino-lint-action Add [a simple workflow file](https://github.com/arduino/arduino-lint-action#usage) to the repository of your Arduino @@ -89,7 +88,7 @@ project and GitHub will automatically run Arduino Lint on every pull request and ## Support and feedback You can discuss or get assistance with using **Arduino Lint** on the -[Arduino Forum](https://forum.arduino.cc/index.php?board=3.0). +[Arduino Forum](https://forum.arduino.cc/c/using-arduino/project-guidance/19). Feedback is welcome! Please submit feature requests or bug reports to the [issue tracker](CONTRIBUTING.md#issue-reports). diff --git a/internal/rule/ruleconfiguration/ruleconfiguration.go b/internal/rule/ruleconfiguration/ruleconfiguration.go index 6900e7113..0e86fa936 100644 --- a/internal/rule/ruleconfiguration/ruleconfiguration.go +++ b/internal/rule/ruleconfiguration/ruleconfiguration.go @@ -1258,7 +1258,7 @@ var configurations = []Type{ Brief: "no readme", Description: "None of the standard README file names (e.g., `README.md`) were found in the library's root folder. This file provides interested parties with a convenient and standardized location to get information about the project.", MessageTemplate: "No readme found. Please document your library.", - Reference: "https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-readmes", + Reference: "https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes", DisableModes: nil, EnableModes: []rulemode.Type{rulemode.Default}, InfoModes: nil, @@ -1275,7 +1275,7 @@ var configurations = []Type{ Brief: "no license file", Description: "None of the standard license file names (e.g., `LICENSE.txt`) were found in the library's root folder. This file provides interested parties with a convenient and standardized location to get information about the project's licensing and is also used by GitHub for automatic license type classification.", MessageTemplate: "No license file found.", - Reference: "https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/licensing-a-repository", + Reference: "https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository", DisableModes: nil, EnableModes: []rulemode.Type{rulemode.Default}, InfoModes: nil, @@ -1462,7 +1462,7 @@ var configurations = []Type{ Brief: "no readme", Description: "None of the standard README file names (e.g., `README.md`) were found in the sketch folder. This file provides interested parties with a convenient and standardized location to get information about the project.", MessageTemplate: "No readme found. Please document your sketch.", - Reference: "https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-readmes", + Reference: "https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes", DisableModes: nil, EnableModes: []rulemode.Type{rulemode.Default}, InfoModes: nil, @@ -1479,7 +1479,7 @@ var configurations = []Type{ Brief: "no license file", Description: "None of the standard license file names (e.g., `LICENSE.txt`) were found in the sketch's root folder. This file provides interested parties with a convenient and standardized location to get information about the project's licensing and is also used by GitHub for automatic license type classification.", MessageTemplate: "No license file found.", - Reference: "https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/licensing-a-repository", + Reference: "https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository", DisableModes: nil, EnableModes: []rulemode.Type{rulemode.Default}, InfoModes: nil, @@ -1530,7 +1530,7 @@ var configurations = []Type{ Brief: "no readme", Description: "None of the standard README file names (e.g., `README.md`) were found in the platform folder. This file provides interested parties with a convenient and standardized location to get information about the project.", MessageTemplate: "No readme found. Please document your boards platform.", - Reference: "https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-readmes", + Reference: "https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes", DisableModes: []rulemode.Type{rulemode.Default}, EnableModes: nil, InfoModes: nil, @@ -1547,7 +1547,7 @@ var configurations = []Type{ Brief: "no license file", Description: "None of the standard license file names (e.g., `LICENSE.txt`) were found in the platform folder. This file provides interested parties with a convenient and standardized location to get information about the project's licensing and is also used by GitHub for automatic license type classification.", MessageTemplate: "No license file found.", - Reference: "https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/licensing-a-repository", + Reference: "https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository", DisableModes: []rulemode.Type{rulemode.Default}, EnableModes: nil, InfoModes: nil, From be98b2a93c95571ef4c0f3fcf6c3b2240ae0f908 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 12 Mar 2022 08:58:52 -0800 Subject: [PATCH 3/5] Configure links to allow localization github.com and wikipedia.org have different localization behaviors depending on the URL. If a language code is specified via the URL, then that language version of the page is loaded, regardless of the language setting of the user's browser. For example, this URL will take the user to the English version of the page even if their browser is configured for Italian: https://en.wikipedia.org/wiki/Arduino If no language code is specified via the URL, then it redirects to the version of the page localized for the user's language preference, where available. For example, if the user has selected "Italian" as their preferred language in their browser settings, then this URL: https://wikipedia.org/wiki/Arduino redirects to: https://it.wikipedia.org/wiki/Arduino --- docs/CONTRIBUTING.md | 12 ++++++------ docs/index.md | 4 ++-- docs/installation.md | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 5b8fdc1db..f0fe06fcb 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -64,13 +64,13 @@ submitting a PR: invocations or parsing of the JSON formatted output when upgrading from an older version of Arduino Lint. - PR titles indirectly become part of the CHANGELOG so it's crucial to provide a good record of **what** change is being made in the title; **why** it was made will go in the PR description, along with - [a link to a GitHub issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) + [a link to a GitHub issue](https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if one exists. - Open your PR against the `main` branch. -- Your PR must pass all [CI](https://en.wikipedia.org/wiki/Continuous_integration) tests before we will merge it. You - can run the CI in your fork by clicking the "Actions" tab and then the "I understand my workflows..." button. If - you're seeing an error and don't think it's your fault, it may not be! The reviewer will help you if there are test - failures that seem not related to the change you are making. +- Your PR must pass all [CI](https://wikipedia.org/wiki/Continuous_integration) tests before we will merge it. You can + run the CI in your fork by clicking the "Actions" tab and then the "I understand my workflows..." button. If you're + seeing an error and don't think it's your fault, it may not be! The reviewer will help you if there are test failures + that seem not related to the change you are making. ### Development prerequisites @@ -183,7 +183,7 @@ Unfortunately, **Licensed** does not have Windows support. An updated cache is also generated whenever the cache is found to be outdated by the by the "Check Go Dependencies" CI workflow and made available for download via the `dep-licenses-cache` -[workflow artifact](https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts). +[workflow artifact](https://docs.github.com/actions/managing-workflow-runs/downloading-workflow-artifacts). diff --git a/docs/index.md b/docs/index.md index 82efc625a..f7b5d0d09 100644 --- a/docs/index.md +++ b/docs/index.md @@ -76,8 +76,8 @@ Additional configuration options intended for internal use or development can be ## Continuous integration **Arduino Lint** would be a great addition to your -[continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) system. Running the tool after each -change to the project can allow you to identify any problems that were introduced. +[continuous integration](https://wikipedia.org/wiki/Continuous_integration) system. Running the tool after each change +to the project can allow you to identify any problems that were introduced. This is easily done by using the `arduino/arduino-lint-action` [GitHub Actions](https://docs.github.com/actions) action: https://github.com/arduino/arduino-lint-action diff --git a/docs/installation.md b/docs/installation.md index 88c714235..1a9cf0289 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -21,8 +21,8 @@ curl -fsSL https://raw.githubusercontent.com/arduino/arduino-lint/main/etc/insta ``` If you would like to use the `arduino-lint` command from any location, install Arduino Lint to a directory already in -your [`PATH`](https://en.wikipedia.org/wiki/PATH%5F%28variable%29) or add the Arduino Lint installation path to your -`PATH` environment variable. +your [`PATH`](https://wikipedia.org/wiki/PATH%5F%28variable%29) or add the Arduino Lint installation path to your `PATH` +environment variable. If you want to download a specific Arduino Lint version, for example `0.9.0` or `nightly-latest`, pass the version number as a parameter like this: @@ -36,8 +36,8 @@ curl -fsSL https://raw.githubusercontent.com/arduino/arduino-lint/main/etc/insta Pre-built binaries for all the supported platforms are available for download from the links below. If you would like to use the `arduino-lint` command from any location, extract the downloaded file to a directory -already in your [`PATH`](https://en.wikipedia.org/wiki/PATH%5F%28variable%29) or add the Arduino Lint installation path -to your `PATH` environment variable. +already in your [`PATH`](https://wikipedia.org/wiki/PATH%5F%28variable%29) or add the Arduino Lint installation path to +your `PATH` environment variable. ### Latest release From 91b24793e382ddea1065fc99df5fbd6fb49bbe65 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 12 Mar 2022 09:15:13 -0800 Subject: [PATCH 4/5] Point user links to docs for "latest" version The documentation hosted at arduino.github.io/arduino-cli is versioned, with the URL determining which version is loaded: - arduino.github.io/arduino-cli/0.20 - documentation content at the time of the latest release of the 0.20.x series - arduino.github.io/arduino-cli/latest - documentation content at the time of the latest release - arduino.github.io/arduino-cli/dev - documentation content at the tip of the default branch Previously, some of the links displayed to users by Arduino Lint were pointing at the "dev" version of that documentation. Since it may not apply to the release versions, or be in an unstable state, the "dev" version of the documentation should only be used by Arduino CLI developers and beta testers. For this reason, the "latest" version will be most appropriate for the users of Arduino Lint. --- internal/rule/ruleconfiguration/ruleconfiguration.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/rule/ruleconfiguration/ruleconfiguration.go b/internal/rule/ruleconfiguration/ruleconfiguration.go index 0e86fa936..fa4b9dfc6 100644 --- a/internal/rule/ruleconfiguration/ruleconfiguration.go +++ b/internal/rule/ruleconfiguration/ruleconfiguration.go @@ -185,7 +185,7 @@ var configurations = []Type{ Subcategory: "source code", ID: "LS008", Brief: "name-header mismatch", - Description: "The match between the `library.properties` `name` field and the filename in an `#include` directive is a factor in the library's [dependency resolution priority](https://arduino.github.io/arduino-cli/dev/sketch-build-process/#dependency-resolution). It's recommended for the primary header filename to match the library name.", + Description: "The match between the `library.properties` `name` field and the filename in an `#include` directive is a factor in the library's [dependency resolution priority](https://arduino.github.io/arduino-cli/latest/sketch-build-process/#dependency-resolution). It's recommended for the primary header filename to match the library name.", MessageTemplate: "No header file found matching library name ({{.}}). Best practices are for primary header filename to match library name.", Reference: "https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format", DisableModes: nil, @@ -559,7 +559,7 @@ var configurations = []Type{ Subcategory: "name field", ID: "LP018", Brief: "not in LM index", - Description: "The library name (as defined by `name` field in [the `library.properties` metadata file](https://arduino.github.io/arduino-cli/dev/library-specification/#library-metadata)) was not found in the Library Manager index, but Arduino Lint was run in the [`--library-manager update` mode](https://arduino.github.io/arduino-lint/latest/commands/arduino-lint/#options), indicating that it was expected there.\n\nBecause the `name` value is the identifier used to install the library and define dependencies, it is not allowed to change after the library has been added to the index.", + Description: "The library name (as defined by `name` field in [the `library.properties` metadata file](https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata)) was not found in the Library Manager index, but Arduino Lint was run in the [`--library-manager update` mode](https://arduino.github.io/arduino-lint/latest/commands/arduino-lint/#options), indicating that it was expected there.\n\nBecause the `name` value is the identifier used to install the library and define dependencies, it is not allowed to change after the library has been added to the index.", MessageTemplate: "Library name {{.}} not found in the Library Manager index. Library names are not allowed to change after being added to the index.", Reference: "https://github.com/arduino/library-registry/blob/main/FAQ.md#how-can-i-change-a-librarys-name", DisableModes: []rulemode.Type{rulemode.Default}, @@ -2907,7 +2907,7 @@ var configurations = []Type{ Brief: "upload.field.FIELD_NAME > max length", Description: "The `tools.UPLOAD_RECIPE_ID.upload.field.FIELD_NAME` property in the platform's `platform.txt` configuration file is longer than the maximum length.", MessageTemplate: "upload.UPLOAD_RECIPE_ID.upload.field.FIELD_NAME property is longer than the maximum length for fields: {{.}}", - Reference: "https://arduino.github.io/arduino-cli/dev/platform-specification/#user-provided-fields", + Reference: "https://arduino.github.io/arduino-cli/latest/platform-specification/#user-provided-fields", DisableModes: nil, EnableModes: []rulemode.Type{rulemode.Default}, InfoModes: nil, @@ -2924,7 +2924,7 @@ var configurations = []Type{ Brief: "upload.field.FIELD_NAME.secret invalid", Description: "The `tools.UPLOAD_RECIPE_ID.upload.field.FIELD_NAME.secret` property in the platform's `platform.txt` configuration file has an invalid value.", MessageTemplate: "tools.UPLOAD_RECIPE_ID.upload.field.FIELD_NAME.secret value is invalid or field(s) {{.}}", - Reference: "https://arduino.github.io/arduino-cli/dev/platform-specification/#user-provided-fields", + Reference: "https://arduino.github.io/arduino-cli/latest/platform-specification/#user-provided-fields", DisableModes: nil, EnableModes: []rulemode.Type{rulemode.Default}, InfoModes: nil, From 484ccbd053c100ac9a79840929e37d6c4f7b9daa Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 12 Mar 2022 09:28:02 -0800 Subject: [PATCH 5/5] Target sketch specification reference links to appropriate section The Arduino Sketch Specification document has had some recent changes to avoid ambiguity. This allows the reference links to now point to the specific section of the specification relevant to that rule so that the user will be able to find the information quickly. --- internal/rule/ruleconfiguration/ruleconfiguration.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/rule/ruleconfiguration/ruleconfiguration.go b/internal/rule/ruleconfiguration/ruleconfiguration.go index fa4b9dfc6..e5099e7e5 100644 --- a/internal/rule/ruleconfiguration/ruleconfiguration.go +++ b/internal/rule/ruleconfiguration/ruleconfiguration.go @@ -1377,7 +1377,7 @@ var configurations = []Type{ Brief: "prohibited character in filename", Description: "A sketch file's name contains a prohibited character.", MessageTemplate: "Prohibited character(s) in file name(s): {{.}}", - Reference: "https://arduino.github.io/arduino-cli/latest/sketch-specification/#sketch-root-folder", + Reference: "https://arduino.github.io/arduino-cli/latest/sketch-specification/#sketch-folders-and-files", DisableModes: nil, EnableModes: []rulemode.Type{rulemode.Default}, InfoModes: nil, @@ -1394,7 +1394,7 @@ var configurations = []Type{ Brief: "file name too long", Description: "The sketch file's name exceeds the maximum length.", MessageTemplate: "File name(s): {{.}} exceed maximum length.", - Reference: "https://arduino.github.io/arduino-cli/latest/sketch-specification/#sketch-root-folder", + Reference: "https://arduino.github.io/arduino-cli/latest/sketch-specification/#sketch-folders-and-files", DisableModes: nil, EnableModes: []rulemode.Type{rulemode.Default}, InfoModes: nil, @@ -1411,7 +1411,7 @@ var configurations = []Type{ Brief: ".pde extension", Description: "A sketch file uses the deprecated `.pde` file extension. The .pde extension is used by both [Processing](https://processing.org/) sketches and Arduino sketches. If the project has supplemental Processing sketches, they should either be in the [`data` subfolder of the sketch](https://arduino.github.io/arduino-cli/latest/sketch-specification/#data-subfolder) or in the [`extras` folder of the library](https://arduino.github.io/arduino-cli/latest/library-specification/#extra-documentation). Arduino sketches should use the modern `.ino` extension.", MessageTemplate: "{{.}} uses deprecated .pde file extension. Use .ino for Arduino sketches.", - Reference: "https://arduino.github.io/arduino-cli/latest/sketch-specification", + Reference: "https://arduino.github.io/arduino-cli/latest/sketch-specification/#additional-code-files", DisableModes: nil, EnableModes: []rulemode.Type{rulemode.Default}, InfoModes: nil,