Skip to content

Commit

Permalink
Merge pull request #1016 from emanspeaks/1015-linter-path-fixes
Browse files Browse the repository at this point in the history
updates to correct linter slashes for mixed platform projects
  • Loading branch information
gnikit committed Dec 11, 2023
2 parents c7dd7a0 + d234716 commit 8b5096f
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, '\\');
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 8b5096f

Please sign in to comment.