Skip to content

Commit

Permalink
updates to correct linter slashes for mixed platform projects
Browse files Browse the repository at this point in the history
  • Loading branch information
emanspeaks authored and gnikit committed Dec 11, 2023
1 parent c7dd7a0 commit d234716
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lint/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ export class FortranLintingProvider {
if (!modout) return [];

modout = resolveVariables(modout);
if (process.platform === 'win32') modout = modout.replace(/\//g, '\\');

Check warning on line 498 in src/lint/provider.ts

View check run for this annotation

Codecov / codecov/patch

src/lint/provider.ts#L498

Added line #L498 was not covered by tests
this.logger.debug(`[lint] moduleOutput: ${modFlag} ${modout}`);
return [modFlag, modout];
}
Expand Down
6 changes: 3 additions & 3 deletions src/util/glob-paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export class GlobPaths {
private globResolution(globPaths: string[]): string[] {
if (globPaths.length === 0) return [];
// Resolve internal variables and expand glob patterns
const globPathsVars = globPaths.map(e => resolveVariables(e));
globPaths = globPaths.map(e => resolveVariables(e));
// fast-glob cannot work with Windows paths
globPaths = globPaths.map(e => e.replace('/\\/g', '/'));
globPaths = globPaths.map(e => e.replace(/\\/g, '/'));
// This needs to be after the resolvevariables since {} are used in globs
// try {
// const globIncPaths: string[] = fg.sync(globPathsVars, {
Expand All @@ -49,7 +49,7 @@ export class GlobPaths {
// } catch (eacces) {
try {
const globIncPaths: string[] = [];
for (const i of globPathsVars) {
for (const i of globPaths) {
// use '/' to match only directories and not files
globIncPaths.push(...glob.sync(i + '/'));
}
Expand Down

0 comments on commit d234716

Please sign in to comment.