Skip to content

Write test to exclude UTF-8 BOM from files in tree #11554

Closed

Description

@xtqqczze

Write a test to exclude regressions from #11546, 0aaf74b

Activity

  1. added
    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
    on Jan 10, 2020
  2. xtqqczze commented on Jan 10, 2020

    @xtqqczze
    ContributorAuthor

    We could use the following code to test for BOM:

    filter hasBom {
        $_.Where{
            $bytes = [byte[]]::new(3)
            $stream = [System.IO.File]::OpenRead($_.FullName)
            $stream.Read($bytes, 0, 3) > $null
            $stream.Close()
            $bytes[0] -eq 0xef -and $bytes[1] -eq 0xbb -and $bytes[2] -eq 0xbf
        }
    }
  3. changed the title [-]Write test for UTF-8 BOM[/-] [+]Write test to exclude UTF-8 BOM from files in tree[/+] on Jan 10, 2020
  4. iSazonov commented on Jan 11, 2020

    @iSazonov
    Collaborator

    Travis Plunk (@TravisEz13) Should it be in static tests?

  5. added
    WG-Quality-Testissues in a test or in test infrastructure
    Issue-Enhancementthe issue is more of a feature request than a bug
    and removed
    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
    on Jan 11, 2020
  6. TravisEz13 commented on Jan 11, 2020

    @TravisEz13
    Member

    Ilya (@iSazonov) yes, this should be a static test.

  7. xtqqczze commented on Jan 20, 2020

    @xtqqczze
    ContributorAuthor

    We should consider setting a code analyzer rule to check for BOM:

    image

    https://github.com/maroontress/StyleChecker/blob/master/doc/rules/ByteOrderMark.md

    GitHub
    StyleChecker is yet another code style checker and refactoring tool like FxCopAnalyzers, StyleCop Analyzers, SonarLint, Roslynator, and so on. - maroontress/StyleChecker
  8. iSazonov commented on Jan 21, 2020

    @iSazonov
    Collaborator

    We could use code analyzer(s) on server side although a script would be more simple.

  9. xtqqczze commented on Jan 21, 2020

    @xtqqczze
    ContributorAuthor

    Ilya (@iSazonov) If we use a code analyzer rule running on PowerShell-CI-static-analysis, we could use the same rule in a local build and for live analysis in the development environment.

  10. xtqqczze commented on Jan 22, 2020

    @xtqqczze
    ContributorAuthor

    See #11654

  11. xtqqczze commented on Jan 22, 2020

    @xtqqczze
    ContributorAuthor

    When DotNetAnalyzers/StyleCopAnalyzers#2100 is implemented we could add the rule for analysis.

  12. iSazonov commented on Jan 22, 2020

    @iSazonov
    Collaborator

    I believe PowerShell script in our static analysis will be simple, fast and reliable.

  13. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  14. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  15. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  16. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreWG-Quality-Testissues in a test or in test infrastructure

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions