[Clang-tidy] applying fixes multiple times on same file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Clang-tidy] applying fixes multiple times on same file

Vassil Vassilev via cfe-dev
Hi,
So After running clang-tidy it did change some warnings very well, but some of them were fixed multiple times like:

-    Event(const std::shared_ptr<EventRecord> &record);
+    explicit explicit Event(const std::shared_ptr<EventRecord> &record);


-} // ga
+} // namespace gamespace ga

-}
+}  // namespace ga // namespace ga  // namespace ga  // namespace ga

-    RecordStream<ga::Event> getRecordStream();
+    RecordStream<ga::Event> getRecordStream() override override;

Is it known feature? Am I doing something wrong?

Piotr

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Clang-tidy] applying fixes multiple times on same file

Vassil Vassilev via cfe-dev
Bump
I can also say that this thing takes place in header files.

Piotr

2015-11-26 21:18 GMT+01:00 Piotr Padlewski <[hidden email]>:
Hi,
So After running clang-tidy it did change some warnings very well, but some of them were fixed multiple times like:

-    Event(const std::shared_ptr<EventRecord> &record);
+    explicit explicit Event(const std::shared_ptr<EventRecord> &record);


-} // ga
+} // namespace gamespace ga

-}
+}  // namespace ga // namespace ga  // namespace ga  // namespace ga

-    RecordStream<ga::Event> getRecordStream();
+    RecordStream<ga::Event> getRecordStream() override override;

Is it known feature? Am I doing something wrong?

Piotr


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Clang-tidy] applying fixes multiple times on same file

Vassil Vassilev via cfe-dev

Are you trying to run it on more than one cpp file at a time? 

I think it precesses all the files first and comes up with a big list of changes, then applies them.  Which means you could get duplicate changes when processing multiple cpp files that include the same headers. 

I just do them one at a time.

On Dec 7, 2015 11:29 AM, "Piotr Padlewski via cfe-dev" <[hidden email]> wrote:
Bump
I can also say that this thing takes place in header files.

Piotr

2015-11-26 21:18 GMT+01:00 Piotr Padlewski <[hidden email]>:
Hi,
So After running clang-tidy it did change some warnings very well, but some of them were fixed multiple times like:

-    Event(const std::shared_ptr<EventRecord> &record);
+    explicit explicit Event(const std::shared_ptr<EventRecord> &record);


-} // ga
+} // namespace gamespace ga

-}
+}  // namespace ga // namespace ga  // namespace ga  // namespace ga

-    RecordStream<ga::Event> getRecordStream();
+    RecordStream<ga::Event> getRecordStream() override override;

Is it known feature? Am I doing something wrong?

Piotr


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Clang-tidy] applying fixes multiple times on same file

Vassil Vassilev via cfe-dev

Ok thanks Don. I think it would be good to provide that information in documentation.

17.12.2015 7:31 AM "don hinton" <[hidden email]> napisał(a):

Are you trying to run it on more than one cpp file at a time? 

I think it precesses all the files first and comes up with a big list of changes, then applies them.  Which means you could get duplicate changes when processing multiple cpp files that include the same headers. 

I just do them one at a time.

On Dec 7, 2015 11:29 AM, "Piotr Padlewski via cfe-dev" <[hidden email]> wrote:
Bump
I can also say that this thing takes place in header files.

Piotr

2015-11-26 21:18 GMT+01:00 Piotr Padlewski <[hidden email]>:
Hi,
So After running clang-tidy it did change some warnings very well, but some of them were fixed multiple times like:

-    Event(const std::shared_ptr<EventRecord> &record);
+    explicit explicit Event(const std::shared_ptr<EventRecord> &record);


-} // ga
+} // namespace gamespace ga

-}
+}  // namespace ga // namespace ga  // namespace ga  // namespace ga

-    RecordStream<ga::Event> getRecordStream();
+    RecordStream<ga::Event> getRecordStream() override override;

Is it known feature? Am I doing something wrong?

Piotr


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Clang-tidy] applying fixes multiple times on same file

Vassil Vassilev via cfe-dev
On Thursday, December 17, 2015 10:02:03 AM Piotr Padlewski via cfe-dev wrote:
> Ok thanks Don. I think it would be good to provide that information in
> documentation.

Heya,

that's why there's the 'run-clang-tidy' python script [1] as part of  clang-
tidy.

It does
- Parallelize the clang-tidy invocations
- Records changes-to-be-made (via `clang-tidy -export-fixes`)
- And only when joining the subprocesses: Applies the changes
  (using clang-apply-replacements)

Hope that helps,

Cheers,
Kevin

[1] https://llvm.org/svn/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/
run-clang-tidy.py

>
> 17.12.2015 7:31 AM "don hinton" <[hidden email]> napisał(a):
> > Are you trying to run it on more than one cpp file at a time?
> >
> > I think it precesses all the files first and comes up with a big list of
> > changes, then applies them.  Which means you could get duplicate changes
> > when processing multiple cpp files that include the same headers.
> >
> > I just do them one at a time.
> > On Dec 7, 2015 11:29 AM, "Piotr Padlewski via cfe-dev" <
> >
> > [hidden email]> wrote:
> >> Bump
> >> I can also say that this thing takes place in header files.
> >>
> >> Piotr
> >>
> >> 2015-11-26 21:18 GMT+01:00 Piotr Padlewski <[hidden email]>:
> >>> Hi,
> >>> So After running clang-tidy it did change some warnings very well, but
> >>> some of them were fixed multiple times like:
> >>>
> >>> -    Event(const std::shared_ptr<EventRecord> &record);
> >>> +    explicit explicit Event(const std::shared_ptr<EventRecord>
> >>> &record);
> >>>
> >>>
> >>> -} // ga
> >>> +} // namespace gamespace ga
> >>>
> >>> -}
> >>> +}  // namespace ga // namespace ga  // namespace ga  // namespace ga
> >>>
> >>> -    RecordStream<ga::Event> getRecordStream();
> >>> +    RecordStream<ga::Event> getRecordStream() override override;
> >>>
> >>> Is it known feature? Am I doing something wrong?
> >>>
> >>> Piotr
> >>
> >> _______________________________________________
> >> cfe-dev mailing list
> >> [hidden email]
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
--
Kevin Funk | [hidden email] | http://kfunk.org
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

signature.asc (188 bytes) Download Attachment