Giter Club home page Giter Club logo

Comments (6)

lukepistrol avatar lukepistrol commented on May 21, 2024

As already said on Discord, my opinion:

Locally I'd prefer to not have strict mode enabled since it's more convenient to test/implement things without fixing small syntax inconsistencies. Once you are ready to commit you should then resolve all the warnings.

But I'm open to other's opinions.

from codeedit.

0xWDG avatar 0xWDG commented on May 21, 2024

I think it is a good idea, to set the local environment to strict.
Otherwise people will create a PR, and SwiftLint will fail, but not locally.

while in development you can always use:

  • // swiftlint:disable RULENAME, // swiftlint:enable RULENAME
  • // swiftlint:disable:next RULENAME
  • // swiftlint:disable:previous RULENAME
  • // swiftlint:disable all
  • // swiftlint:enable all

Maybe it's a good idea to implement something like remove_todos.sh to check for // swiftlint:disable all, or // swiftlint:disable things, in case people forget them.

personally i think // swiftlint:disable RULENAME is placed intended, // swiftlint:disable all can never be intended.

from codeedit.

lukepistrol avatar lukepistrol commented on May 21, 2024

Good point. I agree

from codeedit.

RayZhao1998 avatar RayZhao1998 commented on May 21, 2024

What about adding a pre-commit hook to forbid commit if swiftlint --strict failed and keep local environment normal?

from codeedit.

0xWDG avatar 0xWDG commented on May 21, 2024

What about adding a pre-commit hook to forbid commit if swiftlint --strict failed and keep local environment normal?

Yes and no,
If you make the local environment strict, then you'll see the errors in Xcode, otherwise only in the terminal.
personally i like it more if i see the errors in Xcode instead of the terminal.

from codeedit.

lukepistrol avatar lukepistrol commented on May 21, 2024

A agree with @wdg. I think no one will commit a build containing errors. And even if so we still have the workflow as a safe guard.

from codeedit.

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.