Giter Site home page Giter Site logo

Coding standard compliance about i18n HOT 13 CLOSED

indigoxela avatar indigoxela commented on July 28, 2024
Coding standard compliance

from i18n.

Comments (13)

indigoxela avatar indigoxela commented on July 28, 2024 1

All those missing parameter types will be a bunch of work - it's sometimes hard to tell what the right type is in those nested functions... especially i18n_string is pretty complex.

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024 1

I've left comments on your current PR.

A quick idea: instead of blocking phpcs on files containing classes with underscores even for local phpcs runs (via @codingStandardsIgnoreFile), we could exclude them on the command line run in travisCI.

That way people don't get a test failure on things no one can fix in 1.x, but it's still possible to keep an eye on other violations when run locally.

@serundeputy what do you think?

Affected files:

  • i18n_object.inc
  • i18n_translation/i18n_translation.inc
  • i18n_taxonomy/i18n_taxonomy.inc
  • i18n_path/i18n_path.inc
  • i18n_string/i18n_string.inc
  • i18n_menu/i18n_menu.inc
  • i18n_field/i18n_field.inc

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024

Done. It's impossible to fully comply the standards, though, for instance we can't simply rename existing classes and methods (camelcase).

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024

Reopening this as @serundeputy was so kind to provide a .travis.yml config in a new PR:

#25

from i18n.

serundeputy avatar serundeputy commented on July 28, 2024

Done. It's impossible to fully comply the standards, though, for instance we can't simply rename existing classes and methods (camelcase).

  • for these cases we can/should add
// @TODO: Rename classes to CamelCase in 2.x.
// @codingStandardsIgnoreLine

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024

Regarding @codingStandardsIgnoreLine: we'd need a lot of those, so I'm undecided yet.

Newer phpcs versions would allow to --exclude sniffs via command line, but backdrop/coder requires old 1.5. Ever thought about upgrading? I'm aware this requires rewriting sniffs.

from i18n.

serundeputy avatar serundeputy commented on July 28, 2024

I think about upgrading ... I originally pinned that version to support php 5.3, but these days i'm less concerned about that, but worth noting that backdrop core still supports back to php5.3.

from i18n.

serundeputy avatar serundeputy commented on July 28, 2024

The travis builds/tests are not running. I'd recommend we go through and file PRs per directory.
i18n_forum; PR #26

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024

Nope, we have submodules, that should get completely ignored.

See #1 for details.

In other words: don't waste time on something that we don't actually need. 😉

Submodules to ignore:

  • i18n_block
  • i18n_forum
  • i18n_select
  • i18n_user
  • i18n_variable

The reason why they're still there is to figure out a migration path from D7.

from i18n.

serundeputy avatar serundeputy commented on July 28, 2024

ahh; ok; let me see about telling travis not to check those

from i18n.

serundeputy avatar serundeputy commented on July 28, 2024

ok; assuming these are legit failures: https://travis-ci.org/github/backdrop-contrib/i18n/builds/679360294

from i18n.

serundeputy avatar serundeputy commented on July 28, 2024

That's a great idea!

from i18n.

indigoxela avatar indigoxela commented on July 28, 2024

Although coding standards will be an ongoing task, I'm closing this issue for now, as travisCI test is green.

from i18n.

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.