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
Should we mark some modules as private before v1? #8278
Comments
I believe it's good idea. If a whole review of all modules and classes is deemed like it would delay the release too much, at least mark those modules where privateness is straightforward. It might flexibilize future refactorings :) |
@bbatsov should I work into this? |
Yeah, that's a good idea. |
RuboCop 1.0 might come with breaking API changes rubocop/rubocop#8278 Limit pre-2.0 RuboCop RSpec versions to RuboCop >= 0.87, < 1.0
Makes total sense: if not done otherwise, we'll have to refrain from refactoring and keep all the internals intact to avoid breakages in custom extensions using this internals directly. At least until we hit 2.0, in ~year from now. I was thinking of adding a suffix to all methods and running well-known extensions against this. All the breakages will remain in the public API, all the rest can be made Do you want me to tackle this? |
Actually, @jonatas, it seems to be a great way to do with |
I pushed my branch as #8278, I made some progress but didn't quite finish... |
I'm 👎 on that. It makes the codebase ugly. For anyone already using our "private" methods, that's instant breakage when it might never have to break. |
Sorry, I didn't express myself clearly. We do this temporarily, to separate those that are never used by well-known extensions. If we only mark what is an internal implementation detail with I would personally prefer it to break earlier to avoid |
Ah! Sure, for known "clients" that could be worthwhile to discover issues. |
Many internal Modules and Classes marked as private. Severity marked as public
Ouch! sorry for being late here @pirj, the idea is very simple through the I didn't test but it would be something like: Fast.shortcut(:mark_api_private) do
ruby_files_from(ARGV.last) do |file|
replace_all('class', file) do |node|
insert_before(node.loc.expression, "# @api private\n")
end
end
end and then execute But looking the PR probably it would make some failures as we have several mixes of inner classes with modules. |
RuboCop 1.0 might come with breaking API changes rubocop/rubocop#8278 Limit pre-2.0 RuboCop RSpec versions to RuboCop >= 0.87, < 1.0
RuboCop 1.0 might come with breaking API changes rubocop/rubocop#8278 Limit pre-2.0 RuboCop RSpec versions to RuboCop >= 0.87, < 1.0
RuboCop 1.0 might come with breaking API changes rubocop/rubocop#8278 Limit pre-2.0 RuboCop RSpec versions to RuboCop >= 0.87, < 1.0
RuboCop 1.0 might come with breaking API changes rubocop/rubocop#8278 Limit pre-2.0 RuboCop RSpec versions to RuboCop >= 0.87, < 1.0
When reviewing #8274 I realized that it might be a good idea to mark some internal modules and classes as "@api private" before v1. Or is that too late or futile?
The text was updated successfully, but these errors were encountered: