Skip to content

Commit

Permalink
refactor: Restructure linters (#69)
Browse files Browse the repository at this point in the history
This is our first major refactoring. Several concepts didn't play out
the way we initially thought, and that's ok.

Highlights are:
* Reporters shall no longer produce actual "reports" but rather
  create "LintMessages" and "CoverageInfo"
* Linters become more independent but share a common signature
  ("LinterParameters")
* Linters access and share resources via a @ui5/fs
  "workspace" instance. Resource paths reflect UI5 runtime paths
* Linters are generally async and executed concurrently
  (eventually in workers if we can proof performance improvements)
* A LinterContext instance is proveded to all linters.
    * Linters provide it with their produced  "LintMessages" and
      "CoverageInfo" from which the final "LintResult" is generated.
* The "ui5Types"-Linter is special and executed after all other linters
  have finished (to take any transpiled resources into account)
  • Loading branch information
RandomByte authored Apr 12, 2024
1 parent 2b28e5f commit 5abbfc1
Show file tree
Hide file tree
Showing 67 changed files with 1,178 additions and 1,136 deletions.
6 changes: 3 additions & 3 deletions src/cli/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ConsoleWriter from "@ui5/logger/writers/Console";

export interface LinterArg {
coverage: boolean;
filePaths: string[];
filePaths?: string[];
details: boolean;
format: string;
}
Expand Down Expand Up @@ -120,9 +120,9 @@ async function handleLint(argv: ArgumentsCamelCase<LinterArg>) {

const res = await lintProject({
rootDir: path.join(process.cwd()),
filePaths: filePaths?.map((filePath) => path.resolve(process.cwd(), filePath)),
pathsToLint: filePaths?.map((filePath) => path.resolve(process.cwd(), filePath)),
reportCoverage,
messageDetails: details,
includeMessageDetails: details,
});

if (reportCoverage) {
Expand Down
69 changes: 0 additions & 69 deletions src/detectors/AbstractDetector.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/detectors/BaseReporter.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/detectors/transpilers/AbstractTranspiler.ts

This file was deleted.

153 changes: 0 additions & 153 deletions src/detectors/transpilers/amd/transpiler.ts

This file was deleted.

Loading

0 comments on commit 5abbfc1

Please sign in to comment.