-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Ultimaker/Cura
- Loading branch information
Showing
1,457 changed files
with
13,878 additions
and
531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[project] | ||
name = "printerlinter" | ||
description = "Cura UltiMaker printer linting tool" | ||
version = "0.1.0" | ||
version = "0.1.1" | ||
authors = [ | ||
{ name = "UltiMaker", email = "[email protected]" } | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
from pathlib import Path | ||
from typing import Optional | ||
from typing import Optional, List | ||
|
||
from .linters.profile import Profile | ||
from .linters.defintion import Definition | ||
from .linters.linter import Linter | ||
from .linters.meshes import Meshes | ||
from .linters.directory import Directory | ||
|
||
|
||
def getLinter(file: Path, settings: dict) -> Optional[Linter]: | ||
def getLinter(file: Path, settings: dict) -> Optional[List[Linter]]: | ||
""" Returns a Linter depending on the file format """ | ||
if not file.exists(): | ||
return None | ||
|
||
if ".inst" in file.suffixes and ".cfg" in file.suffixes: | ||
return Profile(file, settings) | ||
return [Directory(file, settings), Profile(file, settings)] | ||
|
||
if ".def" in file.suffixes and ".json" in file.suffixes: | ||
if file.stem in ("fdmprinter.def", "fdmextruder.def"): | ||
return None | ||
return Definition(file, settings) | ||
return [Directory(file, settings), Definition(file, settings)] | ||
|
||
if file.parent.stem == "meshes": | ||
return Meshes(file, settings) | ||
return [Meshes(file, settings)] | ||
|
||
return None | ||
return [Directory(file, settings)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from pathlib import Path | ||
from typing import Iterator | ||
|
||
from ..diagnostic import Diagnostic | ||
from .linter import Linter | ||
|
||
|
||
class Directory(Linter): | ||
def __init__(self, file: Path, settings: dict) -> None: | ||
""" Finds issues in the parent directory""" | ||
super().__init__(file, settings) | ||
|
||
def check(self) -> Iterator[Diagnostic]: | ||
if self._settings["checks"].get("diagnostic-resources-macos-app-directory-name", False): | ||
for check in self.checkForDotInDirName(): | ||
yield check | ||
|
||
yield | ||
|
||
def checkForDotInDirName(self) -> Iterator[Diagnostic]: | ||
""" Check if there is a dot in the directory name, MacOS has trouble signing and notarizing otherwise """ | ||
if any("." in p for p in self._file.parent.parts): | ||
yield Diagnostic( | ||
file = self._file, | ||
diagnostic_name = "diagnostic-resources-macos-app-directory-name", | ||
message = f"Directory name containing a `.` not allowed {self._file.suffix}, rename directory containing this file e.q: `_`", | ||
level = "Error", | ||
offset = 1 | ||
) | ||
yield | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.