build.ps1/build_helpers.ps1 issues

Abierto
#169 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
powershell

Línea de trabajo

Read build.ps1 and tools/build-helpers.ps1, starting with ParseJasmine and RunSpecs, then review ExtractAtom and the build entry points against the linked lines. Done means the listed help, attribute, invocation, path, and parsing issues are addressed without breaking the build or Jasmine output.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Issue Description
build.ps1
tools\build_helpers.ps1
function ExtractAtom
  • doesn't support UNC paths due to $PSScriptRoot and Resolve-Path will format with the filesystem:: provider, which notation is not acceptable to [System.IO.Compression.ZipFile]::ExtractToDirectory() method. This is informational only, due to the fact that UNC paths do not work for NPM anyway.
function ParseJasmine

https://github.com/PowerShell/EditorSyntax/blob/cf27d6e54ff9fc593bfb46d22a671898fb31c0a9/tools/build-helpers.ps1#L38-L56

  • first line starts with using $string parameter, the rest use $_. Surprisingly it works, but only because in RunSpecs the call to ParseJasmine is part of a ForEach-Object which populates the $_ automatic variable.
  • the ^\s+Expected replacement doesn't seem to be working correctly. Maybe Atom/Atom-Grammar-Test has changed? I think 'to equal' now is to be 'instead found'.
  • this function should really be a filter as it might provide a better fit. Note, also demonstrating the 'switch' statement with -regex parameter:
    filter ParseJasmine {
        switch -regex ($_) {
            ^\s+at {
                ''
                break
            }
    
            ^\s+it {
                $_ -replace '^(\s+)(it)', '$1[-] It'
                break
            }
    
            ^\s+Expected {
                $_ -replace '^(\s*)(Expected.*?)\s(instead found .*)', "`$1`$2`n`$1`$3"
                break
            }
    
            default {
                $_
            }
        }
    }
    
    This requires changing RunSpecs:
    https://github.com/PowerShell/EditorSyntax/blob/cf27d6e54ff9fc593bfb46d22a671898fb31c0a9/tools/build-helpers.ps1#L73
    to read more like:
            & $script:ATOM_EXE_PATH --test $specpath *>&1 | ParseJasmine
    
function RunSpecs

I'll post a PR shortly demonstrating these changes.

Lenguaje dominante
PowerShell
Estrellas
151
Forks
55
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PowerShell/EditorSyntax

Todos los issues de PowerShell/EditorSyntax

Issues similares

Más issues de Build System

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.