Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating config based on existing styles #30

Closed
kizu opened this issue Sep 4, 2013 · 4 comments
Closed

Generating config based on existing styles #30

kizu opened this issue Sep 4, 2013 · 4 comments

Comments

@kizu
Copy link
Contributor

kizu commented Sep 4, 2013

This could be kinda a killer-feature.

We could add a possibility to use any given styles instead of setting the config manually.

There could be a lot of use cases for this, two of them:

  1. You could have a file with a sample code that would be used as a template for your other files:

    .blah {
      color: #FFF;
      }
    

    Would set all the config options to the ones were used in this example: space before opening brace, two spaces for indent, uppercase color, trailing semicolon, closing brace on the same level as properties etc.

  2. We could “comb” the styles using the statistics got from all the available CSS files. This way it would be really easy to generate a config for any given project: the most used code style would become a template and all the minor inconsistencies then would be combed down.

@mishanga
Copy link
Contributor

mishanga commented Sep 4, 2013

:) you can try!

@kizu
Copy link
Contributor Author

kizu commented Oct 13, 2013

WIP

@kizu kizu mentioned this issue Oct 13, 2013
17 tasks
@tonyganch
Copy link
Member

A few words on detecting custom sort order.

It may sound weird, but the task is similar to finding a De Bruijn sequence.
It's used in bioinformatics for sequence assembly, but can be modified a bit and used for collecting properties' sort order.

@kizu
Copy link
Contributor Author

kizu commented Oct 17, 2013

I gave the idea of detecting custom sort order some thoughts. And came up with idea that I'm not capable of doing it right now. All the other options (well, almost all of them) can be easily detected and it would work ok with template file, but when it comes to sort order… As there are different cases for detection, only one of them can benefit from the detecting the sort order — generating the code style options for the project. Other two — normalize and using .css file as a template wouldn't benefit from it.

  • Storing this kind of data in a template wouldn't be that pretty: it should be easy to make changes of code style in it and having dozens of declarations there won't help.
  • When it comes to normalize, my first guess is that it would mostly do some random things to users code. I'd say, in most cases, people do not write CSS in any particular order, so the result would be strange average thing that would only harm users. Things like sort order should be made from scratch and by people, not automagically detected from existent something.

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

No branches or pull requests

3 participants