Coder Social home page Coder Social logo

Comments (3)

lyzadanger avatar lyzadanger commented on June 10, 2024

Hi @nicolemors and team!

@mrgerardorodriguez has been looking at this issue, which I had first diagnosed as something fairly simple. The fabricator project has its own .editorconfig, which conflicts with ours—it designates 4-space tabs as indents. Looking at your example, @nicolemors, I immediately assumed the problem was with that.

We hadn't yet replaced the .editorconfig in our fork of fabricator (upon which this repo is based but not forked) because we hadn't at that time made the concrete decision that, yes, we want to take over maintenance on this fork for sure. Swapping in our .editorconfig prematurely would have made the source fork miserable to work with and cause all sorts of conflicty commits.

We should have probably replaced the .editorconfig once we started this project. Which we still will. But it turns out that that is not the problem here.

Some of us know that fabricator also involves an external npm package fabricator-assemble. We don't modify that external package as part of our design ethic here; we treat it as external and not ours.

Part of what that external module does, however, is "beautify" HTML in code examples using js-beautify. Part of that process involves an options object that has nothing to do with .editorconfig at all...it's its own config. So you can see from fabricator-assemble's source that their default options for this are, like their .editorconfig, wrong. Fortunately, like other options in fabricator-assemble, you can pass these options when invoking the task via gulp.

    beautifier: {
        indent_size: 1,
        indent_char: '  ',
        indent_with_tabs: true
    },

Also while investigating this issue, @mrgerardorodriguez found that while Atom's .editorconfig package is fine with an .editorconfig that looks like:

indent_style = space
indent_size = 2
charset = utf-8
end_of_line = lf
insert_final_newline = true

(Our organization-wide editorconfig), Sublime needs

[*]
indent_style = space
indent_size = 2
charset = utf-8
end_of_line = lf
insert_final_newline = true

(note wildcard). That is, Sublime needs to be able to match on the file name/type before applying something. It's possible that the omission of the wildcard in our current one is actually bad/wrong, so that's another side effect of this investigation—we'll want to update our boxen dotfiles version of editorconfig accordingly. I'll track that separately.

I'd like to reduce the scope of this issue to:

  • Replacing the project's .editorconfig with our organization one, with the wildcard amendment
  • Fixing any wildly terrible indent in source for commits in this repo only (trying to convert all fabricator source to our editorconfig conventions would be silly and bad).

Fixing the output as actually reported here—I'll open a different issue for that because the cause is separate from the editorconfig stuff.

To clarify, this fix won't fix the weird indent yet on syntax-highlighted HTML. More soon on that.

from cloudfour.com-patterns.

lyzadanger avatar lyzadanger commented on June 10, 2024

/cc @tylersticka @lharding @erikjung @mrgerardorodriguez @saralohr There's some good info for y'all here.

from cloudfour.com-patterns.

gerardo-rodriguez avatar gerardo-rodriguez commented on June 10, 2024

Changes have been merged! :D

from cloudfour.com-patterns.

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.