Skip to content

Commit 126fe09

Browse files
committed
ci: add codespell checks for local development and CI/CD
1 parent 4ec9db2 commit 126fe09

File tree

46 files changed

+790
-773
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+790
-773
lines changed

.codespellrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[codespell]
2+
skip = _build
3+
ignore-words-list = laf,OT, hart,EHEN,targetIn,dout,DOUT,oen,OEN,EMAC,emac,doubleClick,
4+
write-changes = true

.github/workflows/pre-commit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222
- name: Install pre-commit
2323
run: pip install pre-commit
2424

25+
- name: Install codespell
26+
run: pip install codespell
27+
28+
- name: Run codespell
29+
run: codespell
30+
2531
- name: Validate commit messages
2632
run: |
2733
if [ "${{ github.event_name }}" = "pull_request" ]; then

.pre-commit-config.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,11 @@
99
rev: v1.2.1
1010
hooks:
1111
- id: conventional-precommit-linter
12-
stages: [commit-msg]
12+
stages: [commit-msg]
13+
14+
- repo: https://github.com/codespell-project/codespell
15+
rev: v2.4.1
16+
hooks:
17+
- id: codespell
18+
stages: [pre-commit]
19+
args: [--config=.codespellrc]

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ Fix: Window -> Preferences -> Plug-in Development -> API Baselines -> Missing AP
2929

3030
![image](https://github.com/espressif/idf-eclipse-plugin/assets/69584713/0a879d4f-99e2-4d5a-98ca-a745a6683752)
3131

32-
Fix: in "Project Explorer" -> com.espressif.idf.tests -> com.espressif.idf.ui.test -> META-INF -> doubleclick MANIFEST.MF -> Dependencies -> Add... -> Type "slf4j.api" -> Add&Save.
32+
Fix: in "Project Explorer" -> com.espressif.idf.tests -> com.espressif.idf.ui.test -> META-INF -> double-click MANIFEST.MF -> Dependencies -> Add... -> Type "slf4j.api" -> Add&Save.
3333

34-
* After importing project Eclipse might prompt a wizard to install `Maven Plugin Connectors` to resolve the idf-eclipse-plugins maven errors, make sure you install all of them. But, depending on the version(Eclipse / Extentions), an error may occur:
34+
* After importing project Eclipse might prompt a wizard to install `Maven Plugin Connectors` to resolve the idf-eclipse-plugins maven errors, make sure you install all of them. But, depending on the version(Eclipse / Extensions), an error may occur:
3535

3636
![image](https://github.com/espressif/idf-eclipse-plugin/assets/69584713/048196c9-8ac6-4f10-8095-596ab2ef05f2)
3737

38-
Fix: check the error and delete one of the extention (usually Tycho) - Help -> Install New Software -> Already Installed -> select "Tycho" -> Uninstall.
38+
Fix: check the error and delete one of the extension (usually Tycho) - Help -> Install New Software -> Already Installed -> select "Tycho" -> Uninstall.
3939

4040
* Run as -> SWTBot Test -> may lead to error:
4141

@@ -50,7 +50,7 @@ Fix: Uninstall SWTBot -> Install latest snapshot(04.04.2023): http://download.ec
5050
* Make changes locally on a specific local branch
5151
* Test with Maven Tycho using `$ mvn clean verify -Djarsigner.skip=true`
5252
* Submit a Pull Request(PR)
53-
* It is also recommended that you add or update a Functional Test if you are adding or updating a functionality in plugin. More details about adding SWTBot Funtional test can be found in the README.md in test folder in the repo.
53+
* It is also recommended that you add or update a Functional Test if you are adding or updating a functionality in plugin. More details about adding SWTBot Functional test can be found in the README.md in test folder in the repo.
5454

5555
## Coding Standards and guidelines
5656
* Code formatter https://github.com/espressif/idf-eclipse-plugin/blob/master/resources/espressif_eclipse_formatter.xml

bundles/com.espressif.idf.core/schema/com.espressif.idf.core.toolchain.exsd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta.schema plugin="com.espressif.idf.core" id="com.espressif.idf.core.toolchain" name="esptoolchain"/>
77
</appinfo>
88
<documentation>
9-
An extension point for registering a new esp target with the toolchain information. That includes name, id, arch, toolchain file, toolchain compiler pattern and debugger patten.
9+
An extension point for registering a new esp target with the toolchain information. That includes name, id, arch, toolchain file, toolchain compiler pattern and debugger pattern.
1010
</documentation>
1111
</annotation>
1212

@@ -42,7 +42,7 @@
4242
<attribute name="id" type="string" use="required">
4343
<annotation>
4444
<documentation>
45-
For exmaple riscv32-esp-elf is the id for esp32c2
45+
For example riscv32-esp-elf is the id for esp32c2
4646
</documentation>
4747
</annotation>
4848
</attribute>

bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/EspIdfErrorParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* expression hint pairs. It uses regular expressions to determine if the line matches any error pattern. If a match is
2727
* found, the corresponding hint is associated with the error message and added to the 'allMatchesList'.
2828
*
29-
* The shutdown method is used to trigger the completion of parsing. It notifies listeners registred in the UI plugin
29+
* The shutdown method is used to trigger the completion of parsing. It notifies listeners registered in the UI plugin
3030
* that the list of available hints has changed and providing the accumulated error hint pairs. The 'allMatchesList' is
3131
* then cleared to prepare for the next parsing session.
3232
*

bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/MarkerCleanupJob.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* Error marker clean up job that runs to clean the error markers for the esp_idf_components folder files that are
2121
* actually derived ones from the esp-idf and are not user generated. This is actually done to improve the UX as CDT
22-
* indexer shows unwanted errros
22+
* indexer shows unwanted errors
2323
*
2424
* @author Ali Azam Rana
2525
*

bundles/com.espressif.idf.core/src/com/espressif/idf/core/tools/vo/ToolsVO.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class ToolsVO
3838
private String installType;
3939

4040
@JsonKey(key_name = IToolsJsonKeys.LICENSE_KEY)
41-
private String licesnse;
41+
private String license;
4242

4343
@JsonKey(key_name = IToolsJsonKeys.NAME_KEY)
4444
private String name;
@@ -116,12 +116,12 @@ public void setInstallType(String installType)
116116

117117
public String getLicesnse()
118118
{
119-
return licesnse;
119+
return license;
120120
}
121121

122-
public void setLicesnse(String licesnse)
122+
public void setLicesnse(String license)
123123
{
124-
this.licesnse = licesnse;
124+
this.license = license;
125125
}
126126

127127
public String getName()
@@ -241,7 +241,7 @@ public boolean equals(Object obj)
241241
&& Objects.equals(exportVars, other.exportVars)
242242
&& Objects.equals(infoUrl, other.infoUrl)
243243
&& Objects.equals(installType, other.installType)
244-
&& Objects.equals(licesnse, other.licesnse)
244+
&& Objects.equals(license, other.license)
245245
&& Objects.equals(name, other.name)
246246
&& Objects.equals(supportedTargets, other.supportedTargets)
247247
&& Objects.equals(versionCmd, other.versionCmd)
@@ -254,6 +254,6 @@ public boolean equals(Object obj)
254254
@Override
255255
public int hashCode()
256256
{
257-
return Objects.hash(description, exportPaths, exportVars, infoUrl, installType, licesnse, name, supportedTargets, versionCmd, versionRegex, versionVOs, version, installed);
257+
return Objects.hash(description, exportPaths, exportVars, infoUrl, installType, license, name, supportedTargets, versionCmd, versionRegex, versionVOs, version, installed);
258258
}
259259
}

bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/FileUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ public static void deleteDirectory(File file) throws IOException
413413
}
414414
}
415415

416-
public static File createFileWithContentsInDirectory(String fileName, String content, String direcotry) throws IOException
416+
public static File createFileWithContentsInDirectory(String fileName, String content, String directory) throws IOException
417417
{
418-
java.nio.file.Path directoryPath = java.nio.file.Paths.get(direcotry);
418+
java.nio.file.Path directoryPath = java.nio.file.Paths.get(directory);
419419
java.nio.file.Path filePath = directoryPath.resolve(fileName);
420420
try (FileWriter writer = new FileWriter(filePath.toFile()))
421421
{

bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LspService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void updateAdditionalOptions(String additionalOptions)
5454
return;
5555
}
5656
String qualifier = configuration.qualifier();
57-
InstanceScope.INSTANCE.getNode(qualifier).put(ClangdMetadata.Predefined.additionalOptions.identifer(),
57+
InstanceScope.INSTANCE.getNode(qualifier).put(ClangdMetadata.Predefined.additionalOptions.identifier(),
5858
additionalOptions);
5959
}
6060

@@ -67,19 +67,19 @@ public void updateClangdPath()
6767
return;
6868
}
6969
String qualifier = configuration.qualifier();
70-
InstanceScope.INSTANCE.getNode(qualifier).put(ClangdMetadata.Predefined.clangdPath.identifer(), clangdPath);
70+
InstanceScope.INSTANCE.getNode(qualifier).put(ClangdMetadata.Predefined.clangdPath.identifier(), clangdPath);
7171
}
7272

7373
public void updateQueryDriver()
7474
{
7575
String qualifier = configuration.qualifier();
76-
InstanceScope.INSTANCE.getNode(qualifier).put(ClangdMetadata.Predefined.queryDriver.identifer(), "**"); //$NON-NLS-1$
76+
InstanceScope.INSTANCE.getNode(qualifier).put(ClangdMetadata.Predefined.queryDriver.identifier(), "**"); //$NON-NLS-1$
7777
}
7878

7979
public void updateCompileCommandsDir(String buildDir)
8080
{
8181
String qualifier = configuration.qualifier();
82-
String identifier = ClangdMetadata.Predefined.additionalOptions.identifer();
82+
String identifier = ClangdMetadata.Predefined.additionalOptions.identifier();
8383
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(qualifier);
8484

8585
String existingOptions = preferences.get(identifier, StringUtil.EMPTY);

0 commit comments

Comments
 (0)