GithubHelp home page GithubHelp logo

Comments (6)

grappler avatar grappler commented on July 20, 2024

It may be a WARNING in the theme check but the check fails so it should be REQUIRED.

We want to reduce the number of manual requirements with automated. Once it is automated it the theme sniffs should suffice as documention.

from wpthemereview.

jrfnl avatar jrfnl commented on July 20, 2024

Once it is automated it the theme sniffs should suffice as documention.

I'm not sure I agree with that.

Especially new theme authors - but probably also existing ones - will probably be more comfortable with reading a list of requirements and recommendations.
Having a list with the rules in the handbook makes it so people are not surprised by (new) rules once they get into the review process.
This is similar to how WPCS handles this. The handbook is leading and only rules which are explicit in the handbook get added to the sniff rulesets.

from wpthemereview.

grappler avatar grappler commented on July 20, 2024

Green light to go ahead :
https://make.wordpress.org/themes/2016/07/12/meeting-notes-for-2016-july-12/

Will look for a good way to document the sniffs. Will raise the question at the next team meeting? Perhaps we could track them in a wiki till it is complete.

from wpthemereview.

grappler avatar grappler commented on July 20, 2024

The PR has been merged.

from wpthemereview.

grappler avatar grappler commented on July 20, 2024

Sorry, still need to update the documentation

from wpthemereview.

grappler avatar grappler commented on July 20, 2024

I know the PR has been merged but I think we need to revert this. There is no need for us to require themes to only use of type of line endings.

PHPCS has an internal Warning Internal.LineEndings.Mixed that we can use to make sure the files only have one type of line endings.

The code looks simple enough

        // Check for mixed line endings as these can cause tokenizer errors and we
        // should let the user know that the results they get may be incorrect.
        // This is done by removing all backslashes, removing the newline char we
        // detected, then converting newlines chars into text. If any backslashes
        // are left at the end, we have additional newline chars in use.
        $contents = str_replace('\\', '', $contents);
        $contents = str_replace($this->eolChar, '', $contents);
        $contents = str_replace("\n", '\n', $contents);
        $contents = str_replace("\r", '\r', $contents);
        if (strpos($contents, '\\') !== false) {
            $error = 'File has mixed line endings; this may cause incorrect results';
            $this->addWarning($error, 0, 'Internal.LineEndings.Mixed');
        }

from wpthemereview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.